Code Duplication    Length = 20-22 lines in 3 locations

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

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