Code Duplication    Length = 10-17 lines in 2 locations

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

@@ 2680-2689 (lines=10) @@
2677
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved
2678
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
2679
     */
2680
    public function testLocationMovedReparentHistory()
2681
    {
2682
        $handler = $this->getHandler();
2683
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php');
2684
2685
        $handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false);
2686
        $handler->locationMoved(4, 2, 3);
2687
2688
        $handler->lookup('move-here/move-this-history');
2689
    }
2690
2691
    /**
2692
     * Test for the locationMoved() method.
@@ 4876-4892 (lines=17) @@
4873
     * @depends testLocationSwappedWithReusingNopEntry
4874
     * @group swap
4875
     */
4876
    public function testLocationSwappedWithReusingNopEntryCustomAliasIsDestroyed()
4877
    {
4878
        $handler = $this->getHandler();
4879
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_swap_reusing_nop.php');
4880
4881
        $handler->lookup('jedan/swap-that/search');
4882
        $handler->locationSwapped(316, 314, 317, 315);
4883
4884
        try {
4885
            $handler->lookup('jedan/swap-that/search');
4886
            $this->fail('Custom alias is not destroyed');
4887
        } catch (NotFoundException $e) {
4888
            // Custom alias is destroyed by reusing NOP entry with existing autogenerated alias
4889
            // on the same level (that means link and ID are updated to the existing alias ID,
4890
            // so custom alias children entries are no longer properly linked (parent-link))
4891
        }
4892
    }
4893
4894
    /**
4895
     * Test for the locationSwapped() method.