2017 © Pedro Peláez
 

library webino-dev

Webino developer's module for Zend Framework 2

image

webino/webino-dev

Webino developer's module for Zend Framework 2

  • Wednesday, August 1, 2018
  • by Webino
  • Repository
  • 1 Watchers
  • 1 Stars
  • 8,642 Installations
  • PHP
  • 9 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 2 % Grown

The README.md

Webino developers module
for Zend Framework 2

Module to ease development of the Webino modules., (*1)

Features

  • Smart dependency injection definition generator
  • Base classes for Selenium WebDriver tests
  • Utility functions

Requirements

  • PHP 5.4
  • ZendFramework 2

Setup

Following steps are necessary to get this module working, considering a zf2-skeleton or very similar application:, (*2)

  1. Run php composer.phar require webino/webino-dev:dev-develop
  2. Add WebinoDev to the enabled modules list

QuickStart

Dependency injection definition generator

use WebinoDev\Di\Definition\Generator;

// Autoloader
$loader = require __DIR__ . '/../vendor/autoload.php';
$loader->add(__NAMESPACE__, __DIR__ . '/../src');

// Dump DI definition
(new Generator(__DIR__))->compile()->dump();

With custom paths, relative to vendor directory:, (*3)

(new Generator(__DIR__))->compile(['custom/path/1', 'custom/path/2'])->dump();

With ignored paths:, (*4)

(new Generator(__DIR__))->setIgnore(['regex1', 'regex2', 'etc.'])->compile()->dump();

Selenium WebDriver tests

use WebinoDev\Test\Selenium\AbstractTestCase;

class HomeTest extends AbstractTestCase
{
    public function testHome()
    {
        $this->session->open($this->uri);
        $this->assertNotError();
    }
}

With authentication:, (*5)

use WebinoDev\Test\Selenium\AbstractAuthenticationTestCase;

class AuthenticationTest extends AbstractAuthenticationTestCase
{
    public function testAuthentication()
    {
        $this->session->open($this->uri);
        $this->assertNotError();
        $this->setAuthenticatedCssSelector('.authentication-success');
        $this->authenticate();
    }
}

or use trait:, (*6)

use WebinoDev\Test\Selenium\AbstractTestCase;

class AuthenticationTest extends AbstractTestCase
{
    use AuthenticationTrait;
}

Development

We will appreciate any contributions on development of this module., (*7)

Learn (How to develop webino modules)[], (*8)

Addendum

Please, if you are interested in this Zend Framework module report any issues and don't hesitate to contribute., (*9)

The Versions