| @@ 184-203 (lines=20) @@ | ||
| 181 | ); |
|
| 182 | } |
|
| 183 | ||
| 184 | public function testSortLocationDepth() |
|
| 185 | { |
|
| 186 | $handler = $this->getContentSearchHandler(); |
|
| 187 | ||
| 188 | $locations = $handler->findLocations( |
|
| 189 | new LocationQuery( |
|
| 190 | array( |
|
| 191 | 'filter' => new Criterion\LocationId(array(148, 167, 169, 172)), |
|
| 192 | 'offset' => 0, |
|
| 193 | 'limit' => 10, |
|
| 194 | 'sortClauses' => array(new SortClause\Location\Depth(LocationQuery::SORT_ASC)), |
|
| 195 | ) |
|
| 196 | ) |
|
| 197 | ); |
|
| 198 | ||
| 199 | $this->assertSearchResults( |
|
| 200 | array(167, 172, 169, 148), |
|
| 201 | $locations |
|
| 202 | ); |
|
| 203 | } |
|
| 204 | ||
| 205 | public function testSortLocationDepthAndPath() |
|
| 206 | { |
|
| @@ 229-250 (lines=22) @@ | ||
| 226 | ); |
|
| 227 | } |
|
| 228 | ||
| 229 | public function testSortLocationPriority() |
|
| 230 | { |
|
| 231 | $handler = $this->getContentSearchHandler(); |
|
| 232 | ||
| 233 | $locations = $handler->findLocations( |
|
| 234 | new LocationQuery( |
|
| 235 | array( |
|
| 236 | 'filter' => new Criterion\LocationId(array(149, 156, 167)), |
|
| 237 | 'offset' => 0, |
|
| 238 | 'limit' => 10, |
|
| 239 | 'sortClauses' => array( |
|
| 240 | new SortClause\Location\Priority(LocationQuery::SORT_DESC), |
|
| 241 | ), |
|
| 242 | ) |
|
| 243 | ) |
|
| 244 | ); |
|
| 245 | ||
| 246 | $this->assertSearchResults( |
|
| 247 | array(167, 156, 149), |
|
| 248 | $locations |
|
| 249 | ); |
|
| 250 | } |
|
| 251 | ||
| 252 | public function testSortDateModified() |
|
| 253 | { |
|
| @@ 275-296 (lines=22) @@ | ||
| 272 | ); |
|
| 273 | } |
|
| 274 | ||
| 275 | public function testSortDatePublished() |
|
| 276 | { |
|
| 277 | $handler = $this->getContentSearchHandler(); |
|
| 278 | ||
| 279 | $locations = $handler->findLocations( |
|
| 280 | new LocationQuery( |
|
| 281 | array( |
|
| 282 | 'filter' => new Criterion\LocationId(array(148, 167, 169, 172)), |
|
| 283 | 'offset' => 0, |
|
| 284 | 'limit' => 10, |
|
| 285 | 'sortClauses' => array( |
|
| 286 | new SortClause\DatePublished(LocationQuery::SORT_DESC), |
|
| 287 | ), |
|
| 288 | ) |
|
| 289 | ) |
|
| 290 | ); |
|
| 291 | ||
| 292 | $this->assertSearchResults( |
|
| 293 | array(148, 172, 169, 167), |
|
| 294 | $locations |
|
| 295 | ); |
|
| 296 | } |
|
| 297 | ||
| 298 | public function testSortSectionIdentifier() |
|
| 299 | { |
|