/** * @dataProvider getDateCollection */ public function testDateComparator($collection, $expected = null) { $obj = new ObjectCollection($collection); $obj->setComparator(new DateComparator()); $elements = $obj->sort(); return $elements; }
/** * @dataProvider getDateCollection */ public function testDateComparator($collection, $expected) { $obj = new ObjectCollection($collection); $obj->setComparator(new DateComparator()); $elements = $obj->sort(); $firstElement = array_shift($elements); $this->assertEquals($expected, $firstElement); }