|
@@ 4901-4921 (lines=21) @@
|
| 4898 |
|
* |
| 4899 |
|
* @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationSwapped |
| 4900 |
|
*/ |
| 4901 |
|
public function testLocationSwappedUpdatesLocationPathIdentificationString() |
| 4902 |
|
{ |
| 4903 |
|
$handler = $this->getHandler(); |
| 4904 |
|
$locationGateway = $this->getLocationGateway(); |
| 4905 |
|
$this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_swap_path_identification_string.php'); |
| 4906 |
|
|
| 4907 |
|
$countBeforeReusing = $this->countRows(); |
| 4908 |
|
|
| 4909 |
|
$handler->locationSwapped(314, 2, 315, 2); |
| 4910 |
|
|
| 4911 |
|
$this->assertEquals( |
| 4912 |
|
$countBeforeReusing, |
| 4913 |
|
$this->countRows() |
| 4914 |
|
); |
| 4915 |
|
|
| 4916 |
|
$locationData = $locationGateway->getBasicNodeData(314); |
| 4917 |
|
self::assertEquals('dva', $locationData['path_identification_string']); |
| 4918 |
|
|
| 4919 |
|
$locationData = $locationGateway->getBasicNodeData(315); |
| 4920 |
|
self::assertEquals('jedan', $locationData['path_identification_string']); |
| 4921 |
|
} |
| 4922 |
|
|
| 4923 |
|
/** |
| 4924 |
|
* Test for the locationSwapped() method. |
|
@@ 4930-4950 (lines=21) @@
|
| 4927 |
|
* |
| 4928 |
|
* @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationSwapped |
| 4929 |
|
*/ |
| 4930 |
|
public function testLocationSwappedMultipleLanguagesUpdatesLocationPathIdentificationString() |
| 4931 |
|
{ |
| 4932 |
|
$handler = $this->getHandler(); |
| 4933 |
|
$locationGateway = $this->getLocationGateway(); |
| 4934 |
|
$this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_swap_multilang_path_identification_string.php'); |
| 4935 |
|
|
| 4936 |
|
$countBeforeReusing = $this->countRows(); |
| 4937 |
|
|
| 4938 |
|
$handler->locationSwapped(314, 2, 315, 2); |
| 4939 |
|
|
| 4940 |
|
$this->assertEquals( |
| 4941 |
|
$countBeforeReusing, |
| 4942 |
|
$this->countRows() |
| 4943 |
|
); |
| 4944 |
|
|
| 4945 |
|
$locationData = $locationGateway->getBasicNodeData(314); |
| 4946 |
|
self::assertEquals('zwei', $locationData['path_identification_string']); |
| 4947 |
|
|
| 4948 |
|
$locationData = $locationGateway->getBasicNodeData(315); |
| 4949 |
|
self::assertEquals('jedan', $locationData['path_identification_string']); |
| 4950 |
|
} |
| 4951 |
|
|
| 4952 |
|
/** |
| 4953 |
|
* @return int |