Code Duplication    Length = 10-17 lines in 2 locations

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

@@ 2750-2759 (lines=10) @@
2747
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved
2748
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
2749
     */
2750
    public function testLocationMovedReparentHistory()
2751
    {
2752
        $handler = $this->getHandler();
2753
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php');
2754
2755
        $handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false);
2756
        $handler->locationMoved(4, 2, 3);
2757
2758
        $handler->lookup('move-here/move-this-history');
2759
    }
2760
2761
    /**
2762
     * Test for the locationMoved() method.
@@ 5226-5242 (lines=17) @@
5223
     * @depends testLocationSwappedWithReusingNopEntry
5224
     * @group swap
5225
     */
5226
    public function testLocationSwappedWithReusingNopEntryCustomAliasIsDestroyed()
5227
    {
5228
        $handler = $this->getHandler();
5229
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_swap_reusing_nop.php');
5230
5231
        $handler->lookup('jedan/swap-that/search');
5232
        $handler->locationSwapped(316, 314, 317, 315);
5233
5234
        try {
5235
            $handler->lookup('jedan/swap-that/search');
5236
            $this->fail('Custom alias is not destroyed');
5237
        } catch (NotFoundException $e) {
5238
            // Custom alias is destroyed by reusing NOP entry with existing autogenerated alias
5239
            // on the same level (that means link and ID are updated to the existing alias ID,
5240
            // so custom alias children entries are no longer properly linked (parent-link))
5241
        }
5242
    }
5243
5244
    /**
5245
     * Test for the locationSwapped() method.