| @@ 261-280 (lines=20) @@ | ||
| 258 | ); |
|
| 259 | } |
|
| 260 | ||
| 261 | public function testSortLocationDepth() |
|
| 262 | { |
|
| 263 | $handler = $this->getContentSearchHandler(); |
|
| 264 | ||
| 265 | $locations = $handler->findLocations( |
|
| 266 | new LocationQuery( |
|
| 267 | array( |
|
| 268 | 'filter' => new Criterion\LocationId(array(148, 167, 169, 172)), |
|
| 269 | 'offset' => 0, |
|
| 270 | 'limit' => 10, |
|
| 271 | 'sortClauses' => array(new SortClause\Location\Depth(LocationQuery::SORT_ASC)), |
|
| 272 | ) |
|
| 273 | ) |
|
| 274 | ); |
|
| 275 | ||
| 276 | $this->assertSearchResults( |
|
| 277 | array(167, 172, 169, 148), |
|
| 278 | $locations |
|
| 279 | ); |
|
| 280 | } |
|
| 281 | ||
| 282 | public function testSortLocationDepthAndPath() |
|
| 283 | { |
|
| @@ 306-327 (lines=22) @@ | ||
| 303 | ); |
|
| 304 | } |
|
| 305 | ||
| 306 | public function testSortLocationPriority() |
|
| 307 | { |
|
| 308 | $handler = $this->getContentSearchHandler(); |
|
| 309 | ||
| 310 | $locations = $handler->findLocations( |
|
| 311 | new LocationQuery( |
|
| 312 | array( |
|
| 313 | 'filter' => new Criterion\LocationId(array(149, 156, 167)), |
|
| 314 | 'offset' => 0, |
|
| 315 | 'limit' => 10, |
|
| 316 | 'sortClauses' => array( |
|
| 317 | new SortClause\Location\Priority(LocationQuery::SORT_DESC), |
|
| 318 | ), |
|
| 319 | ) |
|
| 320 | ) |
|
| 321 | ); |
|
| 322 | ||
| 323 | $this->assertSearchResults( |
|
| 324 | array(167, 156, 149), |
|
| 325 | $locations |
|
| 326 | ); |
|
| 327 | } |
|
| 328 | ||
| 329 | public function testSortDateModified() |
|
| 330 | { |
|
| @@ 352-373 (lines=22) @@ | ||
| 349 | ); |
|
| 350 | } |
|
| 351 | ||
| 352 | public function testSortDatePublished() |
|
| 353 | { |
|
| 354 | $handler = $this->getContentSearchHandler(); |
|
| 355 | ||
| 356 | $locations = $handler->findLocations( |
|
| 357 | new LocationQuery( |
|
| 358 | array( |
|
| 359 | 'filter' => new Criterion\LocationId(array(148, 167, 169, 172)), |
|
| 360 | 'offset' => 0, |
|
| 361 | 'limit' => 10, |
|
| 362 | 'sortClauses' => array( |
|
| 363 | new SortClause\DatePublished(LocationQuery::SORT_DESC), |
|
| 364 | ), |
|
| 365 | ) |
|
| 366 | ) |
|
| 367 | ); |
|
| 368 | ||
| 369 | $this->assertSearchResults( |
|
| 370 | array(148, 172, 169, 167), |
|
| 371 | $locations |
|
| 372 | ); |
|
| 373 | } |
|
| 374 | ||
| 375 | public function testSortSectionIdentifier() |
|
| 376 | { |
|