You are here

public function ComparatorTest::testGetSetOperator in Database Sanitize 7

File

vendor/symfony/finder/Tests/Comparator/ComparatorTest.php, line 19

Class

ComparatorTest

Namespace

Symfony\Component\Finder\Tests\Comparator

Code

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');
}