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