| @@ 2607-2645 (lines=39) @@ | ||
| 2604 | * |
|
| 2605 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved |
|
| 2606 | */ |
|
| 2607 | public function testLocationMovedHistorySubtree() |
|
| 2608 | { |
|
| 2609 | $handler = $this->getHandler(); |
|
| 2610 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php'); |
|
| 2611 | ||
| 2612 | $handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false); |
|
| 2613 | $handler->locationMoved(4, 2, 3); |
|
| 2614 | ||
| 2615 | $urlAlias = $handler->lookup('move-this/sub1/sub2'); |
|
| 2616 | self::assertEquals( |
|
| 2617 | new UrlAlias( |
|
| 2618 | array( |
|
| 2619 | 'id' => '5-' . md5('sub2'), |
|
| 2620 | 'type' => UrlAlias::LOCATION, |
|
| 2621 | 'destination' => '6', |
|
| 2622 | 'languageCodes' => array('eng-GB'), |
|
| 2623 | 'pathData' => array( |
|
| 2624 | array( |
|
| 2625 | 'always-available' => false, |
|
| 2626 | 'translations' => array('eng-GB' => 'move-this'), |
|
| 2627 | ), |
|
| 2628 | array( |
|
| 2629 | 'always-available' => false, |
|
| 2630 | 'translations' => array('eng-GB' => 'sub1'), |
|
| 2631 | ), |
|
| 2632 | array( |
|
| 2633 | 'always-available' => false, |
|
| 2634 | 'translations' => array('eng-GB' => 'sub2'), |
|
| 2635 | ), |
|
| 2636 | ), |
|
| 2637 | 'alwaysAvailable' => false, |
|
| 2638 | 'isHistory' => true, |
|
| 2639 | 'isCustom' => false, |
|
| 2640 | 'forward' => false, |
|
| 2641 | ) |
|
| 2642 | ), |
|
| 2643 | $urlAlias |
|
| 2644 | ); |
|
| 2645 | } |
|
| 2646 | ||
| 2647 | /** |
|
| 2648 | * Test for the locationMoved() method. |
|
| @@ 2652-2690 (lines=39) @@ | ||
| 2649 | * |
|
| 2650 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved |
|
| 2651 | */ |
|
| 2652 | public function testLocationMovedReparent() |
|
| 2653 | { |
|
| 2654 | $handler = $this->getHandler(); |
|
| 2655 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php'); |
|
| 2656 | ||
| 2657 | $handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false); |
|
| 2658 | $handler->locationMoved(4, 2, 3); |
|
| 2659 | ||
| 2660 | $urlAlias = $handler->lookup('move-here/move-this/sub1'); |
|
| 2661 | self::assertEquals( |
|
| 2662 | new UrlAlias( |
|
| 2663 | array( |
|
| 2664 | 'id' => '9-' . md5('sub1'), |
|
| 2665 | 'type' => UrlAlias::LOCATION, |
|
| 2666 | 'destination' => '5', |
|
| 2667 | 'languageCodes' => array('eng-GB'), |
|
| 2668 | 'pathData' => array( |
|
| 2669 | array( |
|
| 2670 | 'always-available' => false, |
|
| 2671 | 'translations' => array('eng-GB' => 'move-here'), |
|
| 2672 | ), |
|
| 2673 | array( |
|
| 2674 | 'always-available' => false, |
|
| 2675 | 'translations' => array('eng-GB' => 'move-this'), |
|
| 2676 | ), |
|
| 2677 | array( |
|
| 2678 | 'always-available' => false, |
|
| 2679 | 'translations' => array('eng-GB' => 'sub1'), |
|
| 2680 | ), |
|
| 2681 | ), |
|
| 2682 | 'alwaysAvailable' => false, |
|
| 2683 | 'isHistory' => false, |
|
| 2684 | 'isCustom' => false, |
|
| 2685 | 'forward' => false, |
|
| 2686 | ) |
|
| 2687 | ), |
|
| 2688 | $urlAlias |
|
| 2689 | ); |
|
| 2690 | } |
|
| 2691 | ||
| 2692 | /** |
|
| 2693 | * Test for the locationMoved() method. |
|