|
@@ 2766-2775 (lines=10) @@
|
| 2763 |
|
* @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved |
| 2764 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 2765 |
|
*/ |
| 2766 |
|
public function testLocationMovedReparentHistory() |
| 2767 |
|
{ |
| 2768 |
|
$handler = $this->getHandler(); |
| 2769 |
|
$this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php'); |
| 2770 |
|
|
| 2771 |
|
$handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false); |
| 2772 |
|
$handler->locationMoved(4, 2, 3); |
| 2773 |
|
|
| 2774 |
|
$handler->lookup('move-here/move-this-history'); |
| 2775 |
|
} |
| 2776 |
|
|
| 2777 |
|
/** |
| 2778 |
|
* Test for the locationMoved() method. |
|
@@ 5242-5258 (lines=17) @@
|
| 5239 |
|
* @depends testLocationSwappedWithReusingNopEntry |
| 5240 |
|
* @group swap |
| 5241 |
|
*/ |
| 5242 |
|
public function testLocationSwappedWithReusingNopEntryCustomAliasIsDestroyed() |
| 5243 |
|
{ |
| 5244 |
|
$handler = $this->getHandler(); |
| 5245 |
|
$this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_swap_reusing_nop.php'); |
| 5246 |
|
|
| 5247 |
|
$handler->lookup('jedan/swap-that/search'); |
| 5248 |
|
$handler->locationSwapped(316, 314, 317, 315); |
| 5249 |
|
|
| 5250 |
|
try { |
| 5251 |
|
$handler->lookup('jedan/swap-that/search'); |
| 5252 |
|
$this->fail('Custom alias is not destroyed'); |
| 5253 |
|
} catch (NotFoundException $e) { |
| 5254 |
|
// Custom alias is destroyed by reusing NOP entry with existing autogenerated alias |
| 5255 |
|
// on the same level (that means link and ID are updated to the existing alias ID, |
| 5256 |
|
// so custom alias children entries are no longer properly linked (parent-link)) |
| 5257 |
|
} |
| 5258 |
|
} |
| 5259 |
|
|
| 5260 |
|
/** |
| 5261 |
|
* Test for the locationSwapped() method. |