@@ 4455-4469 (lines=15) @@ | ||
4452 | * |
|
4453 | * @see \eZ\Publish\API\Repository\ContentTypeService::deleteUserDrafts() |
|
4454 | */ |
|
4455 | public function testDeleteUserDrafts() |
|
4456 | { |
|
4457 | $this->expectException(\eZ\Publish\API\Repository\Exceptions\NotFoundException::class); |
|
4458 | ||
4459 | $repository = $this->getRepository(); |
|
4460 | $userService = $repository->getUserService(); |
|
4461 | $permissionResolver = $repository->getPermissionResolver(); |
|
4462 | $contentTypeService = $repository->getContentTypeService(); |
|
4463 | ||
4464 | $draft = $this->createContentTypeDraft(); |
|
4465 | $user = $permissionResolver->getCurrentUserReference(); |
|
4466 | ||
4467 | $contentTypeService->deleteUserDrafts($user->getUserId()); |
|
4468 | $contentTypeDraft = $contentTypeService->loadContentTypeDraft($draft->id); |
|
4469 | } |
|
4470 | } |
|
4471 |
@@ 2054-2069 (lines=16) @@ | ||
2051 | * @depends eZ\Publish\API\Repository\Tests\RoleServiceTest::testAssignRoleToUser |
|
2052 | * @depends eZ\Publish\API\Repository\Tests\RoleServiceTest::testCreateRoleWithAddPolicy |
|
2053 | */ |
|
2054 | public function testGetRoleAssignmentsForUserEmpty() |
|
2055 | { |
|
2056 | $repository = $this->getRepository(); |
|
2057 | $roleService = $repository->getRoleService(); |
|
2058 | ||
2059 | /* BEGIN: Use Case */ |
|
2060 | $permissionResolver = $this->getRepository()->getPermissionResolver(); |
|
2061 | $userService = $repository->getUserService(); |
|
2062 | $adminUser = $userService->loadUser($permissionResolver->getCurrentUserReference()->getUserId()); |
|
2063 | ||
2064 | // Load the currently assigned role |
|
2065 | $roleAssignments = $roleService->getRoleAssignmentsForUser($adminUser); |
|
2066 | /* END: Use Case */ |
|
2067 | ||
2068 | $this->assertCount(0, $roleAssignments); |
|
2069 | } |
|
2070 | ||
2071 | /** |
|
2072 | * Test for the getRoleAssignmentsForUser() method. |