@@ 5258-5278 (lines=21) @@ | ||
5255 | * |
|
5256 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationSwapped |
|
5257 | */ |
|
5258 | public function testLocationSwappedUpdatesLocationPathIdentificationString() |
|
5259 | { |
|
5260 | $handler = $this->getHandler(); |
|
5261 | $locationGateway = $this->getLocationGateway(); |
|
5262 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_swap_path_identification_string.php'); |
|
5263 | ||
5264 | $countBeforeReusing = $this->countRows(); |
|
5265 | ||
5266 | $handler->locationSwapped(314, 2, 315, 2); |
|
5267 | ||
5268 | $this->assertEquals( |
|
5269 | $countBeforeReusing, |
|
5270 | $this->countRows() |
|
5271 | ); |
|
5272 | ||
5273 | $locationData = $locationGateway->getBasicNodeData(314); |
|
5274 | self::assertEquals('dva', $locationData['path_identification_string']); |
|
5275 | ||
5276 | $locationData = $locationGateway->getBasicNodeData(315); |
|
5277 | self::assertEquals('jedan', $locationData['path_identification_string']); |
|
5278 | } |
|
5279 | ||
5280 | /** |
|
5281 | * Test for the locationSwapped() method. |
|
@@ 5287-5307 (lines=21) @@ | ||
5284 | * |
|
5285 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::locationSwapped |
|
5286 | */ |
|
5287 | public function testLocationSwappedMultipleLanguagesUpdatesLocationPathIdentificationString() |
|
5288 | { |
|
5289 | $handler = $this->getHandler(); |
|
5290 | $locationGateway = $this->getLocationGateway(); |
|
5291 | $this->insertDatabaseFixture(__DIR__ . '/_fixtures/urlaliases_swap_multilang_path_identification_string.php'); |
|
5292 | ||
5293 | $countBeforeReusing = $this->countRows(); |
|
5294 | ||
5295 | $handler->locationSwapped(314, 2, 315, 2); |
|
5296 | ||
5297 | $this->assertEquals( |
|
5298 | $countBeforeReusing, |
|
5299 | $this->countRows() |
|
5300 | ); |
|
5301 | ||
5302 | $locationData = $locationGateway->getBasicNodeData(314); |
|
5303 | self::assertEquals('zwei', $locationData['path_identification_string']); |
|
5304 | ||
5305 | $locationData = $locationGateway->getBasicNodeData(315); |
|
5306 | self::assertEquals('jedan', $locationData['path_identification_string']); |
|
5307 | } |
|
5308 | ||
5309 | /** |
|
5310 | * @return int |