|
@@ 513-526 (lines=14) @@
|
| 510 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 511 |
|
* @depends eZ\Publish\API\Repository\Tests\RoleServiceTest::testLoadRole |
| 512 |
|
*/ |
| 513 |
|
public function testLoadRoleThrowsNotFoundException() |
| 514 |
|
{ |
| 515 |
|
$repository = $this->getRepository(); |
| 516 |
|
|
| 517 |
|
$nonExistingRoleId = $this->generateId('role', self::DB_INT_MAX); |
| 518 |
|
/* BEGIN: Use Case */ |
| 519 |
|
|
| 520 |
|
$roleService = $repository->getRoleService(); |
| 521 |
|
|
| 522 |
|
// This call will fail with a NotFoundException, because no such role exists. |
| 523 |
|
$roleService->loadRole($nonExistingRoleId); |
| 524 |
|
|
| 525 |
|
/* END: Use Case */ |
| 526 |
|
} |
| 527 |
|
|
| 528 |
|
/** |
| 529 |
|
* Test for the loadRoleDraft() method. |
|
@@ 535-548 (lines=14) @@
|
| 532 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 533 |
|
* @depends eZ\Publish\API\Repository\Tests\RoleServiceTest::testLoadRoleDraft |
| 534 |
|
*/ |
| 535 |
|
public function testLoadRoleDraftThrowsNotFoundException() |
| 536 |
|
{ |
| 537 |
|
$repository = $this->getRepository(); |
| 538 |
|
|
| 539 |
|
$nonExistingRoleId = $this->generateId('role', self::DB_INT_MAX); |
| 540 |
|
/* BEGIN: Use Case */ |
| 541 |
|
|
| 542 |
|
$roleService = $repository->getRoleService(); |
| 543 |
|
|
| 544 |
|
// This call will fail with a NotFoundException, because no such role exists. |
| 545 |
|
$roleService->loadRoleDraft($nonExistingRoleId); |
| 546 |
|
|
| 547 |
|
/* END: Use Case */ |
| 548 |
|
} |
| 549 |
|
|
| 550 |
|
/** |
| 551 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
|
@@ 553-566 (lines=14) @@
|
| 550 |
|
/** |
| 551 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 552 |
|
*/ |
| 553 |
|
public function testLoadRoleDraftByRoleIdThrowsNotFoundException() |
| 554 |
|
{ |
| 555 |
|
$repository = $this->getRepository(); |
| 556 |
|
|
| 557 |
|
$nonExistingRoleId = $this->generateId('role', self::DB_INT_MAX); |
| 558 |
|
/* BEGIN: Use Case */ |
| 559 |
|
|
| 560 |
|
$roleService = $repository->getRoleService(); |
| 561 |
|
|
| 562 |
|
// This call will fail with a NotFoundException, because no such role exists. |
| 563 |
|
$roleService->loadRoleDraftByRoleId($nonExistingRoleId); |
| 564 |
|
|
| 565 |
|
/* END: Use Case */ |
| 566 |
|
} |
| 567 |
|
|
| 568 |
|
/** |
| 569 |
|
* Test for the loadRoleByIdentifier() method. |