You are here

public function CriteriaTest::testConstructor in Plug 7

File

lib/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CriteriaTest.php, line 18

Class

CriteriaTest

Namespace

Doctrine\Tests\Common\Collections

Code

public function testConstructor() {
  $expr = new Comparison("field", "=", "value");
  $criteria = new Criteria($expr, array(
    "foo" => "ASC",
  ), 10, 20);
  $this
    ->assertSame($expr, $criteria
    ->getWhereExpression());
  $this
    ->assertEquals(array(
    "foo" => "ASC",
  ), $criteria
    ->getOrderings());
  $this
    ->assertEquals(10, $criteria
    ->getFirstResult());
  $this
    ->assertEquals(20, $criteria
    ->getMaxResults());
}