Code Duplication    Length = 39-39 lines in 2 locations

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

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