Code Duplication    Length = 20-22 lines in 3 locations

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

@@ 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
                [
268
                    'filter' => new Criterion\LocationId([148, 167, 169, 172]),
269
                    'offset' => 0,
270
                    'limit' => 10,
271
                    'sortClauses' => [new SortClause\Location\Depth(LocationQuery::SORT_ASC)],
272
                ]
273
            )
274
        );
275
276
        $this->assertSearchResults(
277
            [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
                [
313
                    'filter' => new Criterion\LocationId([149, 156, 167]),
314
                    'offset' => 0,
315
                    'limit' => 10,
316
                    'sortClauses' => [
317
                        new SortClause\Location\Priority(LocationQuery::SORT_DESC),
318
                    ],
319
                ]
320
            )
321
        );
322
323
        $this->assertSearchResults(
324
            [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
                [
359
                    'filter' => new Criterion\LocationId([148, 167, 169, 172]),
360
                    'offset' => 0,
361
                    'limit' => 10,
362
                    'sortClauses' => [
363
                        new SortClause\DatePublished(LocationQuery::SORT_DESC),
364
                    ],
365
                ]
366
            )
367
        );
368
369
        $this->assertSearchResults(
370
            [148, 172, 169, 167],
371
            $locations
372
        );
373
    }
374
375
    public function testSortSectionIdentifier()
376
    {