Code Duplication    Length = 31-32 lines in 2 locations

eZ/Publish/Core/Persistence/Legacy/Tests/Content/Location/Gateway/DoctrineDatabaseTrashTest.php 2 locations

@@ 338-368 (lines=31) @@
335
    /**
336
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::listTrashed
337
     */
338
    public function testListTrashSortedPathStringDesc()
339
    {
340
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php');
341
        $handler = $this->getLocationGateway();
342
        $this->trashSubtree();
343
344
        $this->assertEquals(
345
            [
346
                '/1/2/69/76/',
347
                '/1/2/69/72/75/',
348
                '/1/2/69/72/74/',
349
                '/1/2/69/72/73/',
350
                '/1/2/69/72/',
351
                '/1/2/69/70/71/',
352
                '/1/2/69/70/',
353
                '/1/2/69/',
354
            ],
355
            array_map(
356
                function ($trashItem) {
357
                    return $trashItem['path_string'];
358
                },
359
                $trashList = $handler->listTrashed(
360
                    0,
361
                    null,
362
                    [
363
                        new SortClause\Location\Path(Query::SORT_DESC),
364
                    ]
365
                )
366
            )
367
        );
368
    }
369
370
    /**
371
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::listTrashed
@@ 373-404 (lines=32) @@
370
    /**
371
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::listTrashed
372
     */
373
    public function testListTrashSortedDepth()
374
    {
375
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/full_example_tree.php');
376
        $handler = $this->getLocationGateway();
377
        $this->trashSubtree();
378
379
        $this->assertEquals(
380
            [
381
                '/1/2/69/',
382
                '/1/2/69/76/',
383
                '/1/2/69/72/',
384
                '/1/2/69/70/',
385
                '/1/2/69/72/75/',
386
                '/1/2/69/72/74/',
387
                '/1/2/69/72/73/',
388
                '/1/2/69/70/71/',
389
            ],
390
            array_map(
391
                function ($trashItem) {
392
                    return $trashItem['path_string'];
393
                },
394
                $trashList = $handler->listTrashed(
395
                    0,
396
                    null,
397
                    [
398
                        new SortClause\Location\Depth(),
399
                        new SortClause\Location\Path(Query::SORT_DESC),
400
                    ]
401
                )
402
            )
403
        );
404
    }
405
406
    /**
407
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::cleanupTrash