PHP code example of maks3w / phpunit-methods-trait

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

    

maks3w / phpunit-methods-trait example snippets



use PHPUnit\Framework\Assert;
use PHPUnit\Framework\TestCase;

trait FooTrait {
  use \Maks3w\PhpUnitMethodsTrait\Framework\TestCaseTrait;

  public function testFoo() {
    $mockFoo = $this->getMock('Foo');
    $mockFoo->expects(TestCase::any())
      ->method('getFoo')
      ->willReturn(true)
    ;

    Assert::assertTrue($mockFoo->getFoo());
  }
}