|
@@ 2678-2687 (lines=10) @@
|
| 2675 |
|
* @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved |
| 2676 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 2677 |
|
*/ |
| 2678 |
|
public function testLocationMovedReparentHistory() |
| 2679 |
|
{ |
| 2680 |
|
$handler = $this->getHandler(); |
| 2681 |
|
$this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php'); |
| 2682 |
|
|
| 2683 |
|
$handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false); |
| 2684 |
|
$handler->locationMoved(4, 2, 3); |
| 2685 |
|
|
| 2686 |
|
$handler->lookup('move-here/move-this-history'); |
| 2687 |
|
} |
| 2688 |
|
|
| 2689 |
|
/** |
| 2690 |
|
* Test for the locationMoved() method. |
|
@@ 4874-4890 (lines=17) @@
|
| 4871 |
|
* @depends testLocationSwappedWithReusingNopEntry |
| 4872 |
|
* @group swap |
| 4873 |
|
*/ |
| 4874 |
|
public function testLocationSwappedWithReusingNopEntryCustomAliasIsDestroyed() |
| 4875 |
|
{ |
| 4876 |
|
$handler = $this->getHandler(); |
| 4877 |
|
$this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_swap_reusing_nop.php'); |
| 4878 |
|
|
| 4879 |
|
$handler->lookup('jedan/swap-that/search'); |
| 4880 |
|
$handler->locationSwapped(316, 314, 317, 315); |
| 4881 |
|
|
| 4882 |
|
try { |
| 4883 |
|
$handler->lookup('jedan/swap-that/search'); |
| 4884 |
|
$this->fail('Custom alias is not destroyed'); |
| 4885 |
|
} catch (NotFoundException $e) { |
| 4886 |
|
// Custom alias is destroyed by reusing NOP entry with existing autogenerated alias |
| 4887 |
|
// on the same level (that means link and ID are updated to the existing alias ID, |
| 4888 |
|
// so custom alias children entries are no longer properly linked (parent-link)) |
| 4889 |
|
} |
| 4890 |
|
} |
| 4891 |
|
|
| 4892 |
|
/** |
| 4893 |
|
* Test for the locationSwapped() method. |