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