You are here

public function CollectionTest::testMatchingOrdering in Zircon Profile 8

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

@group DDC-1637

File

vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CollectionTest.php, line 225

Class

CollectionTest

Namespace

Doctrine\Tests\Common\Collections

Code

public function testMatchingOrdering() {
  $this
    ->fillMatchingFixture();
  $col = $this->collection
    ->matching(new Criteria(null, array(
    'foo' => 'DESC',
  )));
  $this
    ->assertInstanceOf('Doctrine\\Common\\Collections\\Collection', $col);
  $this
    ->assertNotSame($col, $this->collection);
  $this
    ->assertEquals(2, count($col));
  $this
    ->assertEquals('baz', $col
    ->first()->foo);
  $this
    ->assertEquals('bar', $col
    ->last()->foo);
}