| @@ 295-315 (lines=21) @@ | ||
| 292 | * |
|
| 293 | * @see \eZ\Publish\API\Repository\URLAliasService::createGlobalUrlAlias() |
|
| 294 | */ |
|
| 295 | public function testCreateGlobalUrlAlias() |
|
| 296 | { |
|
| 297 | $repository = $this->getRepository(); |
|
| 298 | ||
| 299 | /* BEGIN: Use Case */ |
|
| 300 | $urlAliasService = $repository->getURLAliasService(); |
|
| 301 | ||
| 302 | $createdUrlAlias = $urlAliasService->createGlobalUrlAlias( |
|
| 303 | 'module:content/search?SearchText=eZ', |
|
| 304 | '/Home/My-New-Site', |
|
| 305 | 'eng-US' |
|
| 306 | ); |
|
| 307 | /* END: Use Case */ |
|
| 308 | ||
| 309 | $this->assertInstanceOf( |
|
| 310 | URLAlias::class, |
|
| 311 | $createdUrlAlias |
|
| 312 | ); |
|
| 313 | ||
| 314 | return $createdUrlAlias; |
|
| 315 | } |
|
| 316 | ||
| 317 | /** |
|
| 318 | * @param \eZ\Publish\API\Repository\Values\Content\URLAlias |
|
| @@ 346-367 (lines=22) @@ | ||
| 343 | * |
|
| 344 | * @see \eZ\Publish\API\Repository\URLAliasService::createGlobalUrlAlias($resource, $path, $languageCode, $forward) |
|
| 345 | */ |
|
| 346 | public function testCreateGlobalUrlAliasWithForward() |
|
| 347 | { |
|
| 348 | $repository = $this->getRepository(); |
|
| 349 | ||
| 350 | /* BEGIN: Use Case */ |
|
| 351 | $urlAliasService = $repository->getURLAliasService(); |
|
| 352 | ||
| 353 | $createdUrlAlias = $urlAliasService->createGlobalUrlAlias( |
|
| 354 | 'module:content/search?SearchText=eZ', |
|
| 355 | '/Home/My-New-Site', |
|
| 356 | 'eng-US', |
|
| 357 | true |
|
| 358 | ); |
|
| 359 | /* END: Use Case */ |
|
| 360 | ||
| 361 | $this->assertInstanceOf( |
|
| 362 | URLAlias::class, |
|
| 363 | $createdUrlAlias |
|
| 364 | ); |
|
| 365 | ||
| 366 | return $createdUrlAlias; |
|
| 367 | } |
|
| 368 | ||
| 369 | /** |
|
| 370 | * @param \eZ\Publish\API\Repository\Values\Content\URLAlias |
|
| @@ 398-420 (lines=23) @@ | ||
| 395 | * |
|
| 396 | * @see \eZ\Publish\API\Repository\URLAliasService::createGlobalUrlAlias($resource, $path, $languageCode, $forwarding, $alwaysAvailable) |
|
| 397 | */ |
|
| 398 | public function testCreateGlobalUrlAliasWithAlwaysAvailable() |
|
| 399 | { |
|
| 400 | $repository = $this->getRepository(); |
|
| 401 | ||
| 402 | /* BEGIN: Use Case */ |
|
| 403 | $urlAliasService = $repository->getURLAliasService(); |
|
| 404 | ||
| 405 | $createdUrlAlias = $urlAliasService->createGlobalUrlAlias( |
|
| 406 | 'module:content/search?SearchText=eZ', |
|
| 407 | '/Home/My-New-Site', |
|
| 408 | 'eng-US', |
|
| 409 | false, |
|
| 410 | true |
|
| 411 | ); |
|
| 412 | /* END: Use Case */ |
|
| 413 | ||
| 414 | $this->assertInstanceOf( |
|
| 415 | URLAlias::class, |
|
| 416 | $createdUrlAlias |
|
| 417 | ); |
|
| 418 | ||
| 419 | return $createdUrlAlias; |
|
| 420 | } |
|
| 421 | ||
| 422 | /** |
|
| 423 | * @param \eZ\Publish\API\Repository\Values\Content\URLAlias |
|