| @@ 130-149 (lines=20) @@ | ||
| 127 | * |
|
| 128 | * @depends testCreateUrlAlias |
|
| 129 | */ |
|
| 130 | public function testCreateUrlAliasPropertyValues(array $testData) |
|
| 131 | { |
|
| 132 | list($createdUrlAlias, $locationId) = $testData; |
|
| 133 | ||
| 134 | $this->assertNotNull($createdUrlAlias->id); |
|
| 135 | ||
| 136 | $this->assertPropertiesCorrect( |
|
| 137 | [ |
|
| 138 | 'type' => URLAlias::LOCATION, |
|
| 139 | 'destination' => $locationId, |
|
| 140 | 'path' => '/Home/My-New-Site', |
|
| 141 | 'languageCodes' => ['eng-US'], |
|
| 142 | 'alwaysAvailable' => false, |
|
| 143 | 'isHistory' => false, |
|
| 144 | 'isCustom' => true, |
|
| 145 | 'forward' => false, |
|
| 146 | ], |
|
| 147 | $createdUrlAlias |
|
| 148 | ); |
|
| 149 | } |
|
| 150 | ||
| 151 | /** |
|
| 152 | * Test for the createUrlAlias() method. |
|
| @@ 187-206 (lines=20) @@ | ||
| 184 | * |
|
| 185 | * @depends testCreateUrlAliasWithForwarding |
|
| 186 | */ |
|
| 187 | public function testCreateUrlAliasPropertyValuesWithForwarding(array $testData) |
|
| 188 | { |
|
| 189 | list($createdUrlAlias, $locationId) = $testData; |
|
| 190 | ||
| 191 | $this->assertNotNull($createdUrlAlias->id); |
|
| 192 | ||
| 193 | $this->assertPropertiesCorrect( |
|
| 194 | [ |
|
| 195 | 'type' => URLAlias::LOCATION, |
|
| 196 | 'destination' => $locationId, |
|
| 197 | 'path' => '/Home/My-New-Site', |
|
| 198 | 'languageCodes' => ['eng-US'], |
|
| 199 | 'alwaysAvailable' => false, |
|
| 200 | 'isHistory' => false, |
|
| 201 | 'isCustom' => true, |
|
| 202 | 'forward' => true, |
|
| 203 | ], |
|
| 204 | $createdUrlAlias |
|
| 205 | ); |
|
| 206 | } |
|
| 207 | ||
| 208 | /** |
|
| 209 | * Test for the createUrlAlias() method. |
|
| @@ 243-262 (lines=20) @@ | ||
| 240 | * |
|
| 241 | * @depends testCreateUrlAliasWithAlwaysAvailable |
|
| 242 | */ |
|
| 243 | public function testCreateUrlAliasPropertyValuesWithAlwaysAvailable(array $testData) |
|
| 244 | { |
|
| 245 | list($createdUrlAlias, $locationId) = $testData; |
|
| 246 | ||
| 247 | $this->assertNotNull($createdUrlAlias->id); |
|
| 248 | ||
| 249 | $this->assertPropertiesCorrect( |
|
| 250 | [ |
|
| 251 | 'type' => URLAlias::LOCATION, |
|
| 252 | 'destination' => $locationId, |
|
| 253 | 'path' => '/Home/My-New-Site', |
|
| 254 | 'languageCodes' => ['eng-US'], |
|
| 255 | 'alwaysAvailable' => true, |
|
| 256 | 'isHistory' => false, |
|
| 257 | 'isCustom' => true, |
|
| 258 | 'forward' => false, |
|
| 259 | ], |
|
| 260 | $createdUrlAlias |
|
| 261 | ); |
|
| 262 | } |
|
| 263 | ||
| 264 | /** |
|
| 265 | * Test for the createUrlAlias() method. |
|
| @@ 522-541 (lines=20) @@ | ||
| 519 | * |
|
| 520 | * @depends testCreateGlobalUrlAliasForLocation |
|
| 521 | */ |
|
| 522 | public function testCreateGlobalUrlAliasForLocationPropertyValues($testData) |
|
| 523 | { |
|
| 524 | list($createdUrlAlias, $locationId) = $testData; |
|
| 525 | ||
| 526 | $this->assertNotNull($createdUrlAlias->id); |
|
| 527 | ||
| 528 | $this->assertPropertiesCorrect( |
|
| 529 | [ |
|
| 530 | 'type' => URLAlias::LOCATION, |
|
| 531 | 'destination' => $locationId, |
|
| 532 | 'path' => '/Home/My-New-Site-global', |
|
| 533 | 'languageCodes' => ['eng-US'], |
|
| 534 | 'alwaysAvailable' => true, |
|
| 535 | 'isHistory' => false, |
|
| 536 | 'isCustom' => true, |
|
| 537 | 'forward' => false, |
|
| 538 | ], |
|
| 539 | $createdUrlAlias |
|
| 540 | ); |
|
| 541 | } |
|
| 542 | ||
| 543 | /** |
|
| 544 | * @param \eZ\Publish\API\Repository\Values\Content\URLAlias |
|