Code Duplication    Length = 10-17 lines in 2 locations

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

@@ 2694-2703 (lines=10) @@
2691
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved
2692
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
2693
     */
2694
    public function testLocationMovedReparentHistory()
2695
    {
2696
        $handler = $this->getHandler();
2697
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php');
2698
2699
        $handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false);
2700
        $handler->locationMoved(4, 2, 3);
2701
2702
        $handler->lookup('move-here/move-this-history');
2703
    }
2704
2705
    /**
2706
     * Test for the locationMoved() method.
@@ 4890-4906 (lines=17) @@
4887
     * @depends testLocationSwappedWithReusingNopEntry
4888
     * @group swap
4889
     */
4890
    public function testLocationSwappedWithReusingNopEntryCustomAliasIsDestroyed()
4891
    {
4892
        $handler = $this->getHandler();
4893
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_swap_reusing_nop.php');
4894
4895
        $handler->lookup('jedan/swap-that/search');
4896
        $handler->locationSwapped(316, 314, 317, 315);
4897
4898
        try {
4899
            $handler->lookup('jedan/swap-that/search');
4900
            $this->fail('Custom alias is not destroyed');
4901
        } catch (NotFoundException $e) {
4902
            // Custom alias is destroyed by reusing NOP entry with existing autogenerated alias
4903
            // on the same level (that means link and ID are updated to the existing alias ID,
4904
            // so custom alias children entries are no longer properly linked (parent-link))
4905
        }
4906
    }
4907
4908
    /**
4909
     * Test for the locationSwapped() method.