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