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