Code Duplication    Length = 10-17 lines in 2 locations

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

@@ 2698-2707 (lines=10) @@
2695
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved
2696
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
2697
     */
2698
    public function testLocationMovedReparentHistory()
2699
    {
2700
        $handler = $this->getHandler();
2701
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php');
2702
2703
        $handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false);
2704
        $handler->locationMoved(4, 2, 3);
2705
2706
        $handler->lookup('move-here/move-this-history');
2707
    }
2708
2709
    /**
2710
     * Test for the locationMoved() method.
@@ 5174-5190 (lines=17) @@
5171
     * @depends testLocationSwappedWithReusingNopEntry
5172
     * @group swap
5173
     */
5174
    public function testLocationSwappedWithReusingNopEntryCustomAliasIsDestroyed()
5175
    {
5176
        $handler = $this->getHandler();
5177
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_swap_reusing_nop.php');
5178
5179
        $handler->lookup('jedan/swap-that/search');
5180
        $handler->locationSwapped(316, 314, 317, 315);
5181
5182
        try {
5183
            $handler->lookup('jedan/swap-that/search');
5184
            $this->fail('Custom alias is not destroyed');
5185
        } catch (NotFoundException $e) {
5186
            // Custom alias is destroyed by reusing NOP entry with existing autogenerated alias
5187
            // on the same level (that means link and ID are updated to the existing alias ID,
5188
            // so custom alias children entries are no longer properly linked (parent-link))
5189
        }
5190
    }
5191
5192
    /**
5193
     * Test for the locationSwapped() method.