PHP code example of pandora-una / pandora-testes

1. Go to this page and download the library: Download pandora-una/pandora-testes library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pandora-una / pandora-testes example snippets


'pandora-testes' => array(
    'fixtures_namespace' => 'Application\Fixture',
    'entities_namespace' => 'Application\Entity',
    'clean-after-suite' => false,
    'fixtures' => array(
        'base' => array('usuarioWeb'),
        'Usuario' => array(
            'identifier' => 'id',
            'entity_name' => 'SASLoginExterno\Entity\Usuario'
        )
    )
)

namespace Application\Fixture;

use PandoraTestes\Fixture\AbstractFixture;

class Usuario extends AbstractFixture
{

    protected $params = array(
        'email' => '[email protected]',
        'senha' => 'e8d95a51f3af4a3b134bf6bb680a213a'
    );

}

$entityUsuario->setEmail('[email protected]');
$entityUsuario->setSenha('e8d95a51f3af4a3b134bf6bb680a213a');

class Usuario extends AbstractFixture
{

    protected $params = array(
        'email' => '[email protected]',
        'senha' => array('callback' => 'md5', 'value' => '123456'),
    );

}

class TipoUsuario extends AbstractFixture
{
    protected $params = array(
        'descricao' => 'OPERADOR',
    );
}

class Usuario extends AbstractFixture
{
    protected $params = array(
        'email' => '[email protected]',
        'senha' => 'e8d95a51f3af4a3b134bf6bb680a213a'
    );

    protected $associations = array(
        'tipo' => 'tipoUsuario'
    );
}

class Usuario extends AbstractFixture
{

    protected $params = array(
        'email' => '[email protected]',
        'senha' => 'e8d95a51f3af4a3b134bf6bb680a213a'
    );

    protected $associations = array(
        'tipo' => 'tipoUsuario'
    );

    protected $traits = array(
        'segundo' => array(
            'email'=>'[email protected]'
        )
    );

}

class TipoUsuario extends AbstractFixture
{
    protected $params = array(
        'descricao' => 'OPERADOR',
    );

    protected $traits = array(
        'admin' => array(
            'descricao'=>'ADMINISTRADOR'
        )
    );
}

class Usuario extends AbstractFixture
{

    protected $params = array(
        'email' => '[email protected]',
        'senha' => 'e8d95a51f3af4a3b134bf6bb680a213a'
    );

    protected $associations = array(
        'tipo' => 'tipoUsuario'
    );

    protected $traits = array(
        'segundo' => array(
            'email'=>'[email protected]'
        ),
        'administrador' => array(
            'senha' => '21232f297a57a5a743894a0e4a801fc3',
            '_associations' => array(
                'tipo' => 'admin tipoUsuario'
            )
        )
    );
}

use PandoraTestes\Context\PandoraContext;

/**
 * Defines application features from the specific context.
 */
class FeatureContext extends PandoraContext
{
    /**
     * @BeforeSuite
     */
    public static function initializeZendFramework()
    {
        try {
            if (self::$zendApp === null) {
                putenv('APPLICATION_ENV=test');
                $path          = __DIR__.'/../../config/application.config.php';
                self::$zendApp = \Zend\Mvc\Application::init(