PHP code example of phpnomad / tests

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

    

phpnomad / tests example snippets




namespace MyPackage\Tests;

use PHPNomad\Tests\TestCase as PHPNomadTestCase;

class TestCase extends PHPNomadTestCase
{
}



namespace MyPackage\Tests\Unit;

use MyPackage\Services\WidgetBuilder;
use MyPackage\Tests\TestCase;
use PHPNomad\Tests\Traits\WithInaccessibleMethods;

class WidgetBuilderTest extends TestCase
{
    use WithInaccessibleMethods;

    public function testNormalizeHandlesEmptyInput(): void
    {
        $builder = new WidgetBuilder();

        $result = $this->callInaccessibleMethod($builder, 'normalize', '');

        $this->assertSame('', $result);
    }
}