| @@ 268-288 (lines=21) @@ | ||
| 265 | * |
|
| 266 | * @see \eZ\Publish\API\Repository\URLAliasService::createGlobalUrlAlias() |
|
| 267 | */ |
|
| 268 | public function testCreateGlobalUrlAlias() |
|
| 269 | { |
|
| 270 | $repository = $this->getRepository(); |
|
| 271 | ||
| 272 | /* BEGIN: Use Case */ |
|
| 273 | $urlAliasService = $repository->getURLAliasService(); |
|
| 274 | ||
| 275 | $createdUrlAlias = $urlAliasService->createGlobalUrlAlias( |
|
| 276 | 'module:content/search?SearchText=eZ', |
|
| 277 | '/Home/My-New-Site', |
|
| 278 | 'eng-US' |
|
| 279 | ); |
|
| 280 | /* END: Use Case */ |
|
| 281 | ||
| 282 | $this->assertInstanceOf( |
|
| 283 | 'eZ\\Publish\\API\\Repository\\Values\\Content\\URLAlias', |
|
| 284 | $createdUrlAlias |
|
| 285 | ); |
|
| 286 | ||
| 287 | return $createdUrlAlias; |
|
| 288 | } |
|
| 289 | ||
| 290 | /** |
|
| 291 | * @param \eZ\Publish\API\Repository\Values\Content\URLAlias |
|
| @@ 319-340 (lines=22) @@ | ||
| 316 | * |
|
| 317 | * @see \eZ\Publish\API\Repository\URLAliasService::createGlobalUrlAlias($resource, $path, $languageCode, $forward) |
|
| 318 | */ |
|
| 319 | public function testCreateGlobalUrlAliasWithForward() |
|
| 320 | { |
|
| 321 | $repository = $this->getRepository(); |
|
| 322 | ||
| 323 | /* BEGIN: Use Case */ |
|
| 324 | $urlAliasService = $repository->getURLAliasService(); |
|
| 325 | ||
| 326 | $createdUrlAlias = $urlAliasService->createGlobalUrlAlias( |
|
| 327 | 'module:content/search?SearchText=eZ', |
|
| 328 | '/Home/My-New-Site', |
|
| 329 | 'eng-US', |
|
| 330 | true |
|
| 331 | ); |
|
| 332 | /* END: Use Case */ |
|
| 333 | ||
| 334 | $this->assertInstanceOf( |
|
| 335 | 'eZ\\Publish\\API\\Repository\\Values\\Content\\URLAlias', |
|
| 336 | $createdUrlAlias |
|
| 337 | ); |
|
| 338 | ||
| 339 | return $createdUrlAlias; |
|
| 340 | } |
|
| 341 | ||
| 342 | /** |
|
| 343 | * @param \eZ\Publish\API\Repository\Values\Content\URLAlias |
|
| @@ 371-393 (lines=23) @@ | ||
| 368 | * |
|
| 369 | * @see \eZ\Publish\API\Repository\URLAliasService::createGlobalUrlAlias($resource, $path, $languageCode, $forwarding, $alwaysAvailable) |
|
| 370 | */ |
|
| 371 | public function testCreateGlobalUrlAliasWithAlwaysAvailable() |
|
| 372 | { |
|
| 373 | $repository = $this->getRepository(); |
|
| 374 | ||
| 375 | /* BEGIN: Use Case */ |
|
| 376 | $urlAliasService = $repository->getURLAliasService(); |
|
| 377 | ||
| 378 | $createdUrlAlias = $urlAliasService->createGlobalUrlAlias( |
|
| 379 | 'module:content/search?SearchText=eZ', |
|
| 380 | '/Home/My-New-Site', |
|
| 381 | 'eng-US', |
|
| 382 | false, |
|
| 383 | true |
|
| 384 | ); |
|
| 385 | /* END: Use Case */ |
|
| 386 | ||
| 387 | $this->assertInstanceOf( |
|
| 388 | 'eZ\\Publish\\API\\Repository\\Values\\Content\\URLAlias', |
|
| 389 | $createdUrlAlias |
|
| 390 | ); |
|
| 391 | ||
| 392 | return $createdUrlAlias; |
|
| 393 | } |
|
| 394 | ||
| 395 | /** |
|
| 396 | * @param \eZ\Publish\API\Repository\Values\Content\URLAlias |
|