Code Duplication    Length = 10-17 lines in 2 locations

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

@@ 2764-2773 (lines=10) @@
2761
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved
2762
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
2763
     */
2764
    public function testLocationMovedReparentHistory()
2765
    {
2766
        $handler = $this->getHandler();
2767
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php');
2768
2769
        $handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false);
2770
        $handler->locationMoved(4, 2, 3);
2771
2772
        $handler->lookup('move-here/move-this-history');
2773
    }
2774
2775
    /**
2776
     * Test for the locationMoved() method.
@@ 5240-5256 (lines=17) @@
5237
     * @depends testLocationSwappedWithReusingNopEntry
5238
     * @group swap
5239
     */
5240
    public function testLocationSwappedWithReusingNopEntryCustomAliasIsDestroyed()
5241
    {
5242
        $handler = $this->getHandler();
5243
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_swap_reusing_nop.php');
5244
5245
        $handler->lookup('jedan/swap-that/search');
5246
        $handler->locationSwapped(316, 314, 317, 315);
5247
5248
        try {
5249
            $handler->lookup('jedan/swap-that/search');
5250
            $this->fail('Custom alias is not destroyed');
5251
        } catch (NotFoundException $e) {
5252
            // Custom alias is destroyed by reusing NOP entry with existing autogenerated alias
5253
            // on the same level (that means link and ID are updated to the existing alias ID,
5254
            // so custom alias children entries are no longer properly linked (parent-link))
5255
        }
5256
    }
5257
5258
    /**
5259
     * Test for the locationSwapped() method.