for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Ionut\Sylar\Tests\Unit;
use Ionut\Sylar\Filters;
use Ionut\Sylar\NormalizedValue;
use Ionut\Sylar\NormalizedValueVariant;
use Ionut\Sylar\Tests\TestCase;
class FiltersTest extends TestCase
{
public function testMatchesYieldsReport()
$filter = $this->getMock(Filters\FilterInterface::class);
$filter
->expects($this->once())
->method('matches')
->with($this->anything())
->will($this->returnValue('somereport'));
$filters = new Filters([$filter]);
$this->assertEquals(
['somereport'],
iterator_to_array($filters->matches(new NormalizedValue('test')))
);
}
public function testMatchesYieldsNothingWhenFiltersReturnFalse()
->will($this->returnValue(null));
[],