Code Duplication    Length = 20-22 lines in 3 locations

eZ/Publish/Core/Search/Legacy/Tests/Content/HandlerLocationSortTest.php 3 locations

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