| @@ 251-277 (lines=27) @@ | ||
| 248 | ); |
|
| 249 | } |
|
| 250 | ||
| 251 | public function testSortDateModified() |
|
| 252 | { |
|
| 253 | $locator = $this->getContentSearchHandler(); |
|
| 254 | ||
| 255 | $result = $locator->findContent( |
|
| 256 | new Query( |
|
| 257 | array( |
|
| 258 | 'filter' => new Criterion\SectionId(array(2)), |
|
| 259 | 'offset' => 0, |
|
| 260 | 'limit' => 10, |
|
| 261 | 'sortClauses' => array( |
|
| 262 | new SortClause\DateModified(), |
|
| 263 | ), |
|
| 264 | ) |
|
| 265 | ) |
|
| 266 | ); |
|
| 267 | ||
| 268 | $this->assertEquals( |
|
| 269 | array(4, 12, 13, 42, 10, 14, 11, 226), |
|
| 270 | array_map( |
|
| 271 | function ($hit) { |
|
| 272 | return $hit->valueObject->id; |
|
| 273 | }, |
|
| 274 | $result->searchHits |
|
| 275 | ) |
|
| 276 | ); |
|
| 277 | } |
|
| 278 | ||
| 279 | public function testSortDatePublished() |
|
| 280 | { |
|
| @@ 279-305 (lines=27) @@ | ||
| 276 | ); |
|
| 277 | } |
|
| 278 | ||
| 279 | public function testSortDatePublished() |
|
| 280 | { |
|
| 281 | $locator = $this->getContentSearchHandler(); |
|
| 282 | ||
| 283 | $result = $locator->findContent( |
|
| 284 | new Query( |
|
| 285 | array( |
|
| 286 | 'filter' => new Criterion\SectionId(array(2)), |
|
| 287 | 'offset' => 0, |
|
| 288 | 'limit' => 10, |
|
| 289 | 'sortClauses' => array( |
|
| 290 | new SortClause\DatePublished(), |
|
| 291 | ), |
|
| 292 | ) |
|
| 293 | ) |
|
| 294 | ); |
|
| 295 | ||
| 296 | $this->assertEquals( |
|
| 297 | array(4, 10, 11, 12, 13, 14, 226, 42), |
|
| 298 | array_map( |
|
| 299 | function ($hit) { |
|
| 300 | return $hit->valueObject->id; |
|
| 301 | }, |
|
| 302 | $result->searchHits |
|
| 303 | ) |
|
| 304 | ); |
|
| 305 | } |
|
| 306 | ||
| 307 | public function testSortSectionIdentifier() |
|
| 308 | { |
|