Code Duplication    Length = 10-17 lines in 2 locations

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

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