Code Duplication    Length = 39-39 lines in 2 locations

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

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