| @@ 2694-2736 (lines=43) @@ | ||
| 2691 | * |
|
| 2692 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved |
|
| 2693 | */ |
|
| 2694 | public function testLocationMovedReparentSubtree() |
|
| 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/sub2'); |
|
| 2703 | self::assertEquals( |
|
| 2704 | new UrlAlias( |
|
| 2705 | array( |
|
| 2706 | 'id' => '5-' . md5('sub2'), |
|
| 2707 | 'type' => UrlAlias::LOCATION, |
|
| 2708 | 'destination' => '6', |
|
| 2709 | 'languageCodes' => array('eng-GB'), |
|
| 2710 | 'pathData' => array( |
|
| 2711 | array( |
|
| 2712 | 'always-available' => false, |
|
| 2713 | 'translations' => array('eng-GB' => 'move-here'), |
|
| 2714 | ), |
|
| 2715 | array( |
|
| 2716 | 'always-available' => false, |
|
| 2717 | 'translations' => array('eng-GB' => 'move-this'), |
|
| 2718 | ), |
|
| 2719 | array( |
|
| 2720 | 'always-available' => false, |
|
| 2721 | 'translations' => array('eng-GB' => 'sub1'), |
|
| 2722 | ), |
|
| 2723 | array( |
|
| 2724 | 'always-available' => false, |
|
| 2725 | 'translations' => array('eng-GB' => 'sub2'), |
|
| 2726 | ), |
|
| 2727 | ), |
|
| 2728 | 'alwaysAvailable' => false, |
|
| 2729 | 'isHistory' => false, |
|
| 2730 | 'isCustom' => false, |
|
| 2731 | 'forward' => false, |
|
| 2732 | ) |
|
| 2733 | ), |
|
| 2734 | $urlAlias |
|
| 2735 | ); |
|
| 2736 | } |
|
| 2737 | ||
| 2738 | /** |
|
| 2739 | * Test for the locationMoved() method. |
|
| @@ 2743-2785 (lines=43) @@ | ||
| 2740 | * |
|
| 2741 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved |
|
| 2742 | */ |
|
| 2743 | public function testLocationMovedReparentSubtreeHistory() |
|
| 2744 | { |
|
| 2745 | $handler = $this->getHandler(); |
|
| 2746 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php'); |
|
| 2747 | ||
| 2748 | $handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false); |
|
| 2749 | $handler->locationMoved(4, 2, 3); |
|
| 2750 | ||
| 2751 | $urlAlias = $handler->lookup('move-here/move-this/sub1/sub2-history'); |
|
| 2752 | self::assertEquals( |
|
| 2753 | new UrlAlias( |
|
| 2754 | array( |
|
| 2755 | 'id' => '5-' . md5('sub2-history'), |
|
| 2756 | 'type' => UrlAlias::LOCATION, |
|
| 2757 | 'destination' => '6', |
|
| 2758 | 'languageCodes' => array('eng-GB'), |
|
| 2759 | 'pathData' => array( |
|
| 2760 | array( |
|
| 2761 | 'always-available' => false, |
|
| 2762 | 'translations' => array('eng-GB' => 'move-here'), |
|
| 2763 | ), |
|
| 2764 | array( |
|
| 2765 | 'always-available' => false, |
|
| 2766 | 'translations' => array('eng-GB' => 'move-this'), |
|
| 2767 | ), |
|
| 2768 | array( |
|
| 2769 | 'always-available' => false, |
|
| 2770 | 'translations' => array('eng-GB' => 'sub1'), |
|
| 2771 | ), |
|
| 2772 | array( |
|
| 2773 | 'always-available' => false, |
|
| 2774 | 'translations' => array('eng-GB' => 'sub2-history'), |
|
| 2775 | ), |
|
| 2776 | ), |
|
| 2777 | 'alwaysAvailable' => false, |
|
| 2778 | 'isHistory' => true, |
|
| 2779 | 'isCustom' => false, |
|
| 2780 | 'forward' => false, |
|
| 2781 | ) |
|
| 2782 | ), |
|
| 2783 | $urlAlias |
|
| 2784 | ); |
|
| 2785 | } |
|
| 2786 | ||
| 2787 | /** |
|
| 2788 | * Test for the locationCopied() method. |
|