|
@@ 419-430 (lines=12) @@
|
| 416 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\ContentFieldValidationException |
| 417 |
|
* @covers \eZ\Publish\API\Repository\UserService::updateUserGroup |
| 418 |
|
*/ |
| 419 |
|
public function testUpdateUserGroupRequiredFieldEmpty() |
| 420 |
|
{ |
| 421 |
|
$userService = $this->repository->getUserService(); |
| 422 |
|
$contentService = $this->repository->getContentService(); |
| 423 |
|
|
| 424 |
|
$userGroup = $userService->loadUserGroup(42); |
| 425 |
|
$userGroupUpdateStruct = $userService->newUserGroupUpdateStruct(); |
| 426 |
|
$userGroupUpdateStruct->contentUpdateStruct = $contentService->newContentUpdateStruct(); |
| 427 |
|
$userGroupUpdateStruct->contentUpdateStruct->setField('name', '', 'eng-US'); |
| 428 |
|
|
| 429 |
|
$userService->updateUserGroup($userGroup, $userGroupUpdateStruct); |
| 430 |
|
} |
| 431 |
|
|
| 432 |
|
/** |
| 433 |
|
* Test creating a user. |
|
@@ 654-665 (lines=12) @@
|
| 651 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\ContentValidationException |
| 652 |
|
* @covers \eZ\Publish\API\Repository\UserService::updateUser |
| 653 |
|
*/ |
| 654 |
|
public function testUpdateUserThrowsContentValidationException() |
| 655 |
|
{ |
| 656 |
|
$userService = $this->repository->getUserService(); |
| 657 |
|
$contentService = $this->repository->getContentService(); |
| 658 |
|
|
| 659 |
|
$user = $userService->loadUser(14); |
| 660 |
|
$userUpdateStruct = $userService->newUserUpdateStruct(); |
| 661 |
|
$userUpdateStruct->contentUpdateStruct = $contentService->newContentUpdateStruct(); |
| 662 |
|
$userUpdateStruct->contentUpdateStruct->setField('name', '', 'eng-US'); |
| 663 |
|
|
| 664 |
|
$userService->updateUser($user, $userUpdateStruct); |
| 665 |
|
} |
| 666 |
|
|
| 667 |
|
/** |
| 668 |
|
* Test assigning a user group to user. |