| @@ 2383-2421 (lines=39) @@ | ||
| 2380 | * |
|
| 2381 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved |
|
| 2382 | */ |
|
| 2383 | public function testLocationMovedHistorySubtree() |
|
| 2384 | { |
|
| 2385 | $handler = $this->getHandler(); |
|
| 2386 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php'); |
|
| 2387 | ||
| 2388 | $handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false); |
|
| 2389 | $handler->locationMoved(4, 2, 3); |
|
| 2390 | ||
| 2391 | $urlAlias = $handler->lookup('move-this/sub1/sub2'); |
|
| 2392 | self::assertEquals( |
|
| 2393 | new UrlAlias( |
|
| 2394 | array( |
|
| 2395 | 'id' => '5-' . md5('sub2'), |
|
| 2396 | 'type' => UrlAlias::LOCATION, |
|
| 2397 | 'destination' => '6', |
|
| 2398 | 'languageCodes' => array('eng-GB'), |
|
| 2399 | 'pathData' => array( |
|
| 2400 | array( |
|
| 2401 | 'always-available' => false, |
|
| 2402 | 'translations' => array('eng-GB' => 'move-this'), |
|
| 2403 | ), |
|
| 2404 | array( |
|
| 2405 | 'always-available' => false, |
|
| 2406 | 'translations' => array('eng-GB' => 'sub1'), |
|
| 2407 | ), |
|
| 2408 | array( |
|
| 2409 | 'always-available' => false, |
|
| 2410 | 'translations' => array('eng-GB' => 'sub2'), |
|
| 2411 | ), |
|
| 2412 | ), |
|
| 2413 | 'alwaysAvailable' => false, |
|
| 2414 | 'isHistory' => true, |
|
| 2415 | 'isCustom' => false, |
|
| 2416 | 'forward' => false, |
|
| 2417 | ) |
|
| 2418 | ), |
|
| 2419 | $urlAlias |
|
| 2420 | ); |
|
| 2421 | } |
|
| 2422 | ||
| 2423 | /** |
|
| 2424 | * Test for the locationMoved() method. |
|
| @@ 2428-2466 (lines=39) @@ | ||
| 2425 | * |
|
| 2426 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationMoved |
|
| 2427 | */ |
|
| 2428 | public function testLocationMovedReparent() |
|
| 2429 | { |
|
| 2430 | $handler = $this->getHandler(); |
|
| 2431 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_move.php'); |
|
| 2432 | ||
| 2433 | $handler->publishUrlAliasForLocation(4, 3, 'move-this', 'eng-GB', false); |
|
| 2434 | $handler->locationMoved(4, 2, 3); |
|
| 2435 | ||
| 2436 | $urlAlias = $handler->lookup('move-here/move-this/sub1'); |
|
| 2437 | self::assertEquals( |
|
| 2438 | new UrlAlias( |
|
| 2439 | array( |
|
| 2440 | 'id' => '9-' . md5('sub1'), |
|
| 2441 | 'type' => UrlAlias::LOCATION, |
|
| 2442 | 'destination' => '5', |
|
| 2443 | 'languageCodes' => array('eng-GB'), |
|
| 2444 | 'pathData' => array( |
|
| 2445 | array( |
|
| 2446 | 'always-available' => false, |
|
| 2447 | 'translations' => array('eng-GB' => 'move-here'), |
|
| 2448 | ), |
|
| 2449 | array( |
|
| 2450 | 'always-available' => false, |
|
| 2451 | 'translations' => array('eng-GB' => 'move-this'), |
|
| 2452 | ), |
|
| 2453 | array( |
|
| 2454 | 'always-available' => false, |
|
| 2455 | 'translations' => array('eng-GB' => 'sub1'), |
|
| 2456 | ), |
|
| 2457 | ), |
|
| 2458 | 'alwaysAvailable' => false, |
|
| 2459 | 'isHistory' => false, |
|
| 2460 | 'isCustom' => false, |
|
| 2461 | 'forward' => false, |
|
| 2462 | ) |
|
| 2463 | ), |
|
| 2464 | $urlAlias |
|
| 2465 | ); |
|
| 2466 | } |
|
| 2467 | ||
| 2468 | /** |
|
| 2469 | * Test for the locationMoved() method. |
|