Code Duplication    Length = 39-39 lines in 2 locations

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

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