Code Duplication    Length = 43-43 lines in 2 locations

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

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