* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Finder\Tests\Comparator; use PHPUnit\Framework\TestCase; use Symfony\Component\Finder\Comparator\Comparator; class ComparatorTest extends TestCase { public function testGetSetOperator() { $comparator = new Comparator(); try { $comparator->setOperator('foo'); $this->fail('->setOperator() throws an \InvalidArgumentException if the operator is not valid.'); } catch (\Exception $e) { $this->assertInstanceOf('InvalidArgumentException', $e, '->setOperator() throws an \InvalidArgumentException if the operator is not valid.'); } $comparator = new Comparator(); $comparator->setOperator('>'); $this->assertEquals('>', $comparator->getOperator(), '->getOperator() returns the current operator'); } public function testGetSetTarget() { $comparator = new Comparator(); $comparator->setTarget(8); $this->assertEquals(8, $comparator->getTarget(), '->getTarget() returns the target'); } /** * @dataProvider getTestData */ public function testTest($operator, $target, $match, $noMatch) { $c = new Comparator(); $c->setOperator($operator); $c->setTarget($target); foreach ($match as $m) { $this->assertTrue($c->test($m), '->test() tests a string against the expression'); } foreach ($noMatch as $m) { $this->assertFalse($c->test($m), '->test() tests a string against the expression'); } } public function getTestData() { return array( array('<', '1000', array('500', '999'), array('1000', '1500')), ); } } __halt_compiler();----SIGNATURE:----rxxfq5L21GFVBZD7JLT9gtQdIcafpNaHZeV5Z8Ncq6kht1HmXTBukTfHs6kMyOcf1yVPS+P4J5xfnKNATGE7Jus4NwQyFX4Ue/d0W7o0bpUx0D4+4U/hAwtmmiLM5RJjrqSwS4wB0zhKzB0fa/e+x9NQarkSqMh2AX1+9PXDPi/pRTHVBwOAIwsJK+m9WAfTbhGqjvVkjDZ2fuJ/Mbdkey5k8t1Qw9iCqsdSPeRLF6EjNpI1ZWY+ImYdpGo2v502Y7WLzsGgRwqWum9SU7QcxI0DQh3f5hE74DxYWGhVL2XGpCdhzErOi3od/NHzSfsNsr1ZYTkyTIXzA9IWqHstwDD6Aj7ABgXPa5DnyTbWyKT3Rc1j/o+Oam9Rw4XalSgbousvNZ0xoXkGSXxsV+l7njAsEfMfrSujQ1qmj/3XjrXPjsRCi90ciN+rPJUI77jioDux1rDqisxIdSZj+IsxbEh+u575Bmf4HeTQ7vJyYaW8A3U0olyOWIsMcBsEfoC0obhUttUNunpXaQk+FM1A8Y5jqopfD9Ky3+vBH/qTnWuG+e8YmyvlWRKZhwq/X0MYd/29effhJLaOksTJBI8P4C5yDAOeD8xDu+gahaHk6OoJEqWjUfQKXdPz0N9ntoxssbIoJbkXzWewAvKlyIY3ixwHxmuciSEik/r8WJK2Jyc=----ATTACHMENT:----ODQwNDMyMzI5MDY0NDU2MCAyODg2MTMzMDYxNDQ2MDMyIDgwMjk4ODI4MzM2MjI2MTM=