PHP code example of modera / tests-runner

1. Go to this page and download the library: Download modera/tests-runner 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/ */

    

modera / tests-runner example snippets

 php


return [
    new \Modera\TestsRunner\Interceptors\ServerEnvExportingInterceptor(array(
        'SYMFONY__DB_HOST' => 'mysql',
        'SYMFONY__DB_PORT' => 3306,
        'SYMFONY__DB_USER' => 'root',
        'SYMFONY__DB_PASSWORD' => '123123'
    )),
    new \Modera\TestsRunner\Interceptors\SymfonyPhpUnitEnvInterceptor(),
    new \Modera\TestsRunner\Interceptors\MySqlInterceptor(
        function() { // config provider
            return array(
                'host' => $_SERVER['SYMFONY__DB_HOST'],
                'user' => $_SERVER['SYMFONY__DB_USER'],
                'password' => $_SERVER['SYMFONY__DB_PASSWORD'],
                'port' => $_SERVER['SYMFONY__DB_PORT'],
                'attempts' => isset($_SERVER['DB_ATTEMPTS']) ? $_SERVER['DB_ATTEMPTS'] : 40,
            );
        }
    ),
];
 xml
<listeners>
    <listener class="Modera\TestsRunner\PhpUnitListener" file="./vendor/modera/tests-runner/src/Modera/TestsRunner/PhpUnitListener.php"></listener>
</listeners>