Code Duplication    Length = 43-43 lines in 2 locations

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

@@ 2710-2752 (lines=43) @@
2707
     *
2708
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved
2709
     */
2710
    public function testLocationMovedReparentSubtree()
2711
    {
2712
        $handler = $this->getHandler();
2713
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php');
2714
2715
        $handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false);
2716
        $handler->locationMoved(4, 2, 3);
2717
2718
        $urlAlias = $handler->lookup('move-here/move-this/sub1/sub2');
2719
        self::assertEquals(
2720
            new UrlAlias(
2721
                array(
2722
                    'id' => '5-' . md5('sub2'),
2723
                    'type' => UrlAlias::LOCATION,
2724
                    'destination' => '6',
2725
                    'languageCodes' => array('eng-GB'),
2726
                    'pathData' => array(
2727
                        array(
2728
                            'always-available' => false,
2729
                            'translations' => array('eng-GB' => 'move-here'),
2730
                        ),
2731
                        array(
2732
                            'always-available' => false,
2733
                            'translations' => array('eng-GB' => 'move-this'),
2734
                        ),
2735
                        array(
2736
                            'always-available' => false,
2737
                            'translations' => array('eng-GB' => 'sub1'),
2738
                        ),
2739
                        array(
2740
                            'always-available' => false,
2741
                            'translations' => array('eng-GB' => 'sub2'),
2742
                        ),
2743
                    ),
2744
                    'alwaysAvailable' => false,
2745
                    'isHistory' => false,
2746
                    'isCustom' => false,
2747
                    'forward' => false,
2748
                )
2749
            ),
2750
            $urlAlias
2751
        );
2752
    }
2753
2754
    /**
2755
     * Test for the locationMoved() method.
@@ 2759-2801 (lines=43) @@
2756
     *
2757
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved
2758
     */
2759
    public function testLocationMovedReparentSubtreeHistory()
2760
    {
2761
        $handler = $this->getHandler();
2762
        $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php');
2763
2764
        $handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false);
2765
        $handler->locationMoved(4, 2, 3);
2766
2767
        $urlAlias = $handler->lookup('move-here/move-this/sub1/sub2-history');
2768
        self::assertEquals(
2769
            new UrlAlias(
2770
                array(
2771
                    'id' => '5-' . md5('sub2-history'),
2772
                    'type' => UrlAlias::LOCATION,
2773
                    'destination' => '6',
2774
                    'languageCodes' => array('eng-GB'),
2775
                    'pathData' => array(
2776
                        array(
2777
                            'always-available' => false,
2778
                            'translations' => array('eng-GB' => 'move-here'),
2779
                        ),
2780
                        array(
2781
                            'always-available' => false,
2782
                            'translations' => array('eng-GB' => 'move-this'),
2783
                        ),
2784
                        array(
2785
                            'always-available' => false,
2786
                            'translations' => array('eng-GB' => 'sub1'),
2787
                        ),
2788
                        array(
2789
                            'always-available' => false,
2790
                            'translations' => array('eng-GB' => 'sub2-history'),
2791
                        ),
2792
                    ),
2793
                    'alwaysAvailable' => false,
2794
                    'isHistory' => true,
2795
                    'isCustom' => false,
2796
                    'forward' => false,
2797
                )
2798
            ),
2799
            $urlAlias
2800
        );
2801
    }
2802
2803
    /**
2804
     * Test for the locationCopied() method.