PHP code example of esperance / esperance-phpunit

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

    

esperance / esperance-phpunit example snippets



s YourTestCase extends \Esperance\PHPUnit\TestCase
{
    public function testSomething()
    {
        $this->expect(1 + 1)->to->be(2);
        $this->expect("foo" . "bar")->to->be("foobar")->and->not->to->be('baz');
        $this->expect(new ArrayObject)->to->be->an('ArrayObject');
        $this->expect(function () {
            throw new RuntimeException;
        })->to->throw('RuntimeException');
    }
}