|
@@ 465-480 (lines=16) @@
|
| 462 |
|
* |
| 463 |
|
* @see \eZ\Publish\Core\Repository\URLService::findUrls() |
| 464 |
|
*/ |
| 465 |
|
public function testFindUrlsWithInvalidOffsetThrowsInvalidArgumentException() |
| 466 |
|
{ |
| 467 |
|
$this->expectException(\eZ\Publish\Core\Base\Exceptions\InvalidArgumentValue::class); |
| 468 |
|
|
| 469 |
|
$query = new URLQuery(); |
| 470 |
|
$query->filter = new Criterion\MatchAll(); |
| 471 |
|
$query->offset = 'invalid!'; |
| 472 |
|
|
| 473 |
|
$repository = $this->getRepository(); |
| 474 |
|
|
| 475 |
|
/* BEGIN: Use Case */ |
| 476 |
|
$urlService = $repository->getURLService(); |
| 477 |
|
// This call will fail with a InvalidArgumentException |
| 478 |
|
$urlService->findUrls($query); |
| 479 |
|
/* END: Use Case */ |
| 480 |
|
} |
| 481 |
|
|
| 482 |
|
/** |
| 483 |
|
* Test for URLService::findUrls() method. |
|
@@ 487-502 (lines=16) @@
|
| 484 |
|
* |
| 485 |
|
* @see \eZ\Publish\Core\Repository\URLService::findUrls() |
| 486 |
|
*/ |
| 487 |
|
public function testFindUrlsWithInvalidLimitThrowsInvalidArgumentException() |
| 488 |
|
{ |
| 489 |
|
$this->expectException(\eZ\Publish\Core\Base\Exceptions\InvalidArgumentValue::class); |
| 490 |
|
|
| 491 |
|
$query = new URLQuery(); |
| 492 |
|
$query->filter = new Criterion\MatchAll(); |
| 493 |
|
$query->limit = 'invalid!'; |
| 494 |
|
|
| 495 |
|
$repository = $this->getRepository(); |
| 496 |
|
|
| 497 |
|
/* BEGIN: Use Case */ |
| 498 |
|
$urlService = $repository->getURLService(); |
| 499 |
|
// This call will fail with a InvalidArgumentException |
| 500 |
|
$urlService->findUrls($query); |
| 501 |
|
/* END: Use Case */ |
| 502 |
|
} |
| 503 |
|
|
| 504 |
|
/** |
| 505 |
|
* Test for URLService::findUrls() method. |