public function CriteriaTest::testAndWhere

File

drupal/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Collections/CriteriaTest.php, line 38

Class

CriteriaTest

Namespace

Doctrine\Tests\Common\Collections

Code

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