You are here

public function CriteriaTest::testOrWhere in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CriteriaTest.php \Doctrine\Tests\Common\Collections\CriteriaTest::testOrWhere()

File

vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CriteriaTest.php, line 55

Class

CriteriaTest

Namespace

Doctrine\Tests\Common\Collections

Code

public function testOrWhere() {
  $expr = new Comparison("field", "=", "value");
  $criteria = new Criteria();
  $criteria
    ->where($expr);
  $expr = $criteria
    ->getWhereExpression();
  $criteria
    ->orWhere($expr);
  $where = $criteria
    ->getWhereExpression();
  $this
    ->assertInstanceOf('Doctrine\\Common\\Collections\\Expr\\CompositeExpression', $where);
  $this
    ->assertEquals(CompositeExpression::TYPE_OR, $where
    ->getType());
  $this
    ->assertSame(array(
    $expr,
    $expr,
  ), $where
    ->getExpressionList());
}