| @@ 2782-2824 (lines=43) @@ | ||
| 2779 | * |
|
| 2780 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved |
|
| 2781 | */ |
|
| 2782 | public function testLocationMovedReparentSubtree() |
|
| 2783 | { |
|
| 2784 | $handler = $this->getHandler(); |
|
| 2785 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php'); |
|
| 2786 | ||
| 2787 | $handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false); |
|
| 2788 | $handler->locationMoved(4, 2, 3); |
|
| 2789 | ||
| 2790 | $urlAlias = $handler->lookup('move-here/move-this/sub1/sub2'); |
|
| 2791 | self::assertEquals( |
|
| 2792 | new UrlAlias( |
|
| 2793 | array( |
|
| 2794 | 'id' => '5-' . md5('sub2'), |
|
| 2795 | 'type' => UrlAlias::LOCATION, |
|
| 2796 | 'destination' => '6', |
|
| 2797 | 'languageCodes' => array('eng-GB'), |
|
| 2798 | 'pathData' => array( |
|
| 2799 | array( |
|
| 2800 | 'always-available' => false, |
|
| 2801 | 'translations' => array('eng-GB' => 'move-here'), |
|
| 2802 | ), |
|
| 2803 | array( |
|
| 2804 | 'always-available' => false, |
|
| 2805 | 'translations' => array('eng-GB' => 'move-this'), |
|
| 2806 | ), |
|
| 2807 | array( |
|
| 2808 | 'always-available' => false, |
|
| 2809 | 'translations' => array('eng-GB' => 'sub1'), |
|
| 2810 | ), |
|
| 2811 | array( |
|
| 2812 | 'always-available' => false, |
|
| 2813 | 'translations' => array('eng-GB' => 'sub2'), |
|
| 2814 | ), |
|
| 2815 | ), |
|
| 2816 | 'alwaysAvailable' => false, |
|
| 2817 | 'isHistory' => false, |
|
| 2818 | 'isCustom' => false, |
|
| 2819 | 'forward' => false, |
|
| 2820 | ) |
|
| 2821 | ), |
|
| 2822 | $urlAlias |
|
| 2823 | ); |
|
| 2824 | } |
|
| 2825 | ||
| 2826 | /** |
|
| 2827 | * Test for the locationMoved() method. |
|
| @@ 2831-2873 (lines=43) @@ | ||
| 2828 | * |
|
| 2829 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved |
|
| 2830 | */ |
|
| 2831 | public function testLocationMovedReparentSubtreeHistory() |
|
| 2832 | { |
|
| 2833 | $handler = $this->getHandler(); |
|
| 2834 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php'); |
|
| 2835 | ||
| 2836 | $handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false); |
|
| 2837 | $handler->locationMoved(4, 2, 3); |
|
| 2838 | ||
| 2839 | $urlAlias = $handler->lookup('move-here/move-this/sub1/sub2-history'); |
|
| 2840 | self::assertEquals( |
|
| 2841 | new UrlAlias( |
|
| 2842 | array( |
|
| 2843 | 'id' => '5-' . md5('sub2-history'), |
|
| 2844 | 'type' => UrlAlias::LOCATION, |
|
| 2845 | 'destination' => '6', |
|
| 2846 | 'languageCodes' => array('eng-GB'), |
|
| 2847 | 'pathData' => array( |
|
| 2848 | array( |
|
| 2849 | 'always-available' => false, |
|
| 2850 | 'translations' => array('eng-GB' => 'move-here'), |
|
| 2851 | ), |
|
| 2852 | array( |
|
| 2853 | 'always-available' => false, |
|
| 2854 | 'translations' => array('eng-GB' => 'move-this'), |
|
| 2855 | ), |
|
| 2856 | array( |
|
| 2857 | 'always-available' => false, |
|
| 2858 | 'translations' => array('eng-GB' => 'sub1'), |
|
| 2859 | ), |
|
| 2860 | array( |
|
| 2861 | 'always-available' => false, |
|
| 2862 | 'translations' => array('eng-GB' => 'sub2-history'), |
|
| 2863 | ), |
|
| 2864 | ), |
|
| 2865 | 'alwaysAvailable' => false, |
|
| 2866 | 'isHistory' => true, |
|
| 2867 | 'isCustom' => false, |
|
| 2868 | 'forward' => false, |
|
| 2869 | ) |
|
| 2870 | ), |
|
| 2871 | $urlAlias |
|
| 2872 | ); |
|
| 2873 | } |
|
| 2874 | ||
| 2875 | /** |
|
| 2876 | * Test for the locationCopied() method. |
|