Code Duplication    Length = 10-17 lines in 2 locations

eZ/Publish/Core/Persistence/Legacy/Tests/Content/UrlAlias/UrlAliasHandlerTest.php 2 locations

@@ 2474-2483 (lines=10) @@
2471
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved
2472
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
2473
     */
2474
    public function testLocationMovedReparentHistory()
2475
    {
2476
        $handler = $this->getHandler();
2477
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php');
2478
2479
        $handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false);
2480
        $handler->locationMoved(4, 2, 3);
2481
2482
        $handler->lookup('move-here/move-this-history');
2483
    }
2484
2485
    /**
2486
     * Test for the locationMoved() method.
@@ 4636-4652 (lines=17) @@
4633
     * @depends testLocationSwappedWithReusingNopEntry
4634
     * @group swap
4635
     */
4636
    public function testLocationSwappedWithReusingNopEntryCustomAliasIsDestroyed()
4637
    {
4638
        $handler = $this->getHandler();
4639
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_swap_reusing_nop.php');
4640
4641
        $handler->lookup('jedan/swap-that/search');
4642
        $handler->locationSwapped(316, 314, 317, 315);
4643
4644
        try {
4645
            $handler->lookup('jedan/swap-that/search');
4646
            $this->fail('Custom alias is not destroyed');
4647
        } catch (NotFoundException $e) {
4648
            // Custom alias is destroyed by reusing NOP entry with existing autogenerated alias
4649
            // on the same level (that means link and ID are updated to the existing alias ID,
4650
            // so custom alias children entries are no longer properly linked (parent-link))
4651
        }
4652
    }
4653
4654
    /**
4655
     * Test for the locationSwapped() method.