Code Duplication    Length = 43-43 lines in 2 locations

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

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