Code Duplication    Length = 43-43 lines in 2 locations

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

@@ 2766-2808 (lines=43) @@
2763
     *
2764
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved
2765
     */
2766
    public function testLocationMovedReparentSubtree()
2767
    {
2768
        $handler = $this->getHandler();
2769
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php');
2770
2771
        $handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false);
2772
        $handler->locationMoved(4, 2, 3);
2773
2774
        $urlAlias = $handler->lookup('move-here/move-this/sub1/sub2');
2775
        self::assertEquals(
2776
            new UrlAlias(
2777
                [
2778
                    'id' => '5-' . md5('sub2'),
2779
                    'type' => UrlAlias::LOCATION,
2780
                    'destination' => '6',
2781
                    'languageCodes' => ['eng-GB'],
2782
                    'pathData' => [
2783
                        [
2784
                            'always-available' => false,
2785
                            'translations' => ['eng-GB' => 'move-here'],
2786
                        ],
2787
                        [
2788
                            'always-available' => false,
2789
                            'translations' => ['eng-GB' => 'move-this'],
2790
                        ],
2791
                        [
2792
                            'always-available' => false,
2793
                            'translations' => ['eng-GB' => 'sub1'],
2794
                        ],
2795
                        [
2796
                            'always-available' => false,
2797
                            'translations' => ['eng-GB' => 'sub2'],
2798
                        ],
2799
                    ],
2800
                    'alwaysAvailable' => false,
2801
                    'isHistory' => false,
2802
                    'isCustom' => false,
2803
                    'forward' => false,
2804
                ]
2805
            ),
2806
            $urlAlias
2807
        );
2808
    }
2809
2810
    /**
2811
     * Test for the locationMoved() method.
@@ 2815-2857 (lines=43) @@
2812
     *
2813
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved
2814
     */
2815
    public function testLocationMovedReparentSubtreeHistory()
2816
    {
2817
        $handler = $this->getHandler();
2818
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php');
2819
2820
        $handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false);
2821
        $handler->locationMoved(4, 2, 3);
2822
2823
        $urlAlias = $handler->lookup('move-here/move-this/sub1/sub2-history');
2824
        self::assertEquals(
2825
            new UrlAlias(
2826
                [
2827
                    'id' => '5-' . md5('sub2-history'),
2828
                    'type' => UrlAlias::LOCATION,
2829
                    'destination' => '6',
2830
                    'languageCodes' => ['eng-GB'],
2831
                    'pathData' => [
2832
                        [
2833
                            'always-available' => false,
2834
                            'translations' => ['eng-GB' => 'move-here'],
2835
                        ],
2836
                        [
2837
                            'always-available' => false,
2838
                            'translations' => ['eng-GB' => 'move-this'],
2839
                        ],
2840
                        [
2841
                            'always-available' => false,
2842
                            'translations' => ['eng-GB' => 'sub1'],
2843
                        ],
2844
                        [
2845
                            'always-available' => false,
2846
                            'translations' => ['eng-GB' => 'sub2-history'],
2847
                        ],
2848
                    ],
2849
                    'alwaysAvailable' => false,
2850
                    'isHistory' => true,
2851
                    'isCustom' => false,
2852
                    'forward' => false,
2853
                ]
2854
            ),
2855
            $urlAlias
2856
        );
2857
    }
2858
2859
    /**
2860
     * Test for the locationCopied() method.