Code Duplication    Length = 39-39 lines in 2 locations

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

@@ 2662-2700 (lines=39) @@
2659
     *
2660
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved
2661
     */
2662
    public function testLocationMovedHistorySubtree()
2663
    {
2664
        $handler = $this->getHandler();
2665
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php');
2666
2667
        $handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false);
2668
        $handler->locationMoved(4, 2, 3);
2669
2670
        $urlAlias = $handler->lookup('move-this/sub1/sub2');
2671
        self::assertEquals(
2672
            new UrlAlias(
2673
                [
2674
                    'id' => '5-' . md5('sub2'),
2675
                    'type' => UrlAlias::LOCATION,
2676
                    'destination' => '6',
2677
                    'languageCodes' => ['eng-GB'],
2678
                    'pathData' => [
2679
                        [
2680
                            'always-available' => false,
2681
                            'translations' => ['eng-GB' => 'move-this'],
2682
                        ],
2683
                        [
2684
                            'always-available' => false,
2685
                            'translations' => ['eng-GB' => 'sub1'],
2686
                        ],
2687
                        [
2688
                            'always-available' => false,
2689
                            'translations' => ['eng-GB' => 'sub2'],
2690
                        ],
2691
                    ],
2692
                    'alwaysAvailable' => false,
2693
                    'isHistory' => true,
2694
                    'isCustom' => false,
2695
                    'forward' => false,
2696
                ]
2697
            ),
2698
            $urlAlias
2699
        );
2700
    }
2701
2702
    /**
2703
     * Test for the locationMoved() method.
@@ 2707-2745 (lines=39) @@
2704
     *
2705
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved
2706
     */
2707
    public function testLocationMovedReparent()
2708
    {
2709
        $handler = $this->getHandler();
2710
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php');
2711
2712
        $handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false);
2713
        $handler->locationMoved(4, 2, 3);
2714
2715
        $urlAlias = $handler->lookup('move-here/move-this/sub1');
2716
        self::assertEquals(
2717
            new UrlAlias(
2718
                [
2719
                    'id' => '9-' . md5('sub1'),
2720
                    'type' => UrlAlias::LOCATION,
2721
                    'destination' => '5',
2722
                    'languageCodes' => ['eng-GB'],
2723
                    'pathData' => [
2724
                        [
2725
                            'always-available' => false,
2726
                            'translations' => ['eng-GB' => 'move-here'],
2727
                        ],
2728
                        [
2729
                            'always-available' => false,
2730
                            'translations' => ['eng-GB' => 'move-this'],
2731
                        ],
2732
                        [
2733
                            'always-available' => false,
2734
                            'translations' => ['eng-GB' => 'sub1'],
2735
                        ],
2736
                    ],
2737
                    'alwaysAvailable' => false,
2738
                    'isHistory' => false,
2739
                    'isCustom' => false,
2740
                    'forward' => false,
2741
                ]
2742
            ),
2743
            $urlAlias
2744
        );
2745
    }
2746
2747
    /**
2748
     * Test for the locationMoved() method.