public function ClosureExpressionVisitorTest::testSortDelegate in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ClosureExpressionVisitorTest.php \Doctrine\Tests\Common\Collections\ClosureExpressionVisitorTest::testSortDelegate()
File
- vendor/
doctrine/ collections/ tests/ Doctrine/ Tests/ Common/ Collections/ ClosureExpressionVisitorTest.php, line 192
Class
- ClosureExpressionVisitorTest
- @group DDC-1637
Namespace
Doctrine\Tests\Common\CollectionsCode
public function testSortDelegate() {
$objects = array(
new TestObject("a", "c"),
new TestObject("a", "b"),
new TestObject("a", "a"),
);
$sort = ClosureExpressionVisitor::sortByField("bar", 1);
$sort = ClosureExpressionVisitor::sortByField("foo", 1, $sort);
usort($objects, $sort);
$this
->assertEquals("a", $objects[0]
->getBar());
$this
->assertEquals("b", $objects[1]
->getBar());
$this
->assertEquals("c", $objects[2]
->getBar());
}