PHP code example of fakerino / phpunit-ext

1. Go to this page and download the library: Download fakerino/phpunit-ext 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/ */

    

fakerino / phpunit-ext example snippets


<listeners>
        <listener class='FakerinoPhpUnitListener'
                        file='vendor/fakerino/phpunit-ext/src/Fakerino/PHPUnit/FakerinoPhpUnitListener.php'/>
</listeners>

    /**
     * @fakeDataProvider name, surname, integer, date
     */
    public function testSimpleProvider($name, $surname, $intvalue, $date)
    {
        $this->assertInternalType("string", $name);
        $this->assertInternalType("string", $surname);
        $this->assertInternalType("integer", $intvalue);
        $this->assertTrue((bool)preg_match('/\d{4}-\d{2}-\d{2}/', $date));
    }