PHP code example of thomasnordahldk / tester

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

    

thomasnordahldk / tester example snippets


class MyTestCase implements TestCase
{
    public function getDescription(): string
    {
        return "My new unit test";
    }
    
    public function run(Tester $tester): void
    {
        $tester->assert(true, "This assertion passes!");
        $tester->assert(false, "This assertion fails!");
    }
}

$unit_tests = new TestSuite("Unit tests", [new UserUnitTest, AddressUnitTest]);

# test.php
$unit_tests = new TestSuite("Unit tests", [new UserUnitTest, new AddressUnitTest]);

return [$unit_tests];