eZ\Publish\Core\Search\Legacy\Tests\Content\HandlerContentSortTest::testSortDatePublished PHP Method

testSortDatePublished() public method

    public function testSortDatePublished()
    {
        $locator = $this->getContentSearchHandler();
        $result = $locator->findContent(new Query(array('filter' => new Criterion\SectionId(array(2)), 'offset' => 0, 'limit' => 10, 'sortClauses' => array(new SortClause\DatePublished()))));
        $this->assertEquals(array(4, 10, 11, 12, 13, 14, 226, 42), array_map(function ($hit) {
            return $hit->valueObject->id;
        }, $result->searchHits));
    }