|
@@ 490-500 (lines=11) @@
|
| 487 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\ContentFieldValidationException |
| 488 |
|
* @covers \eZ\Publish\API\Repository\UserService::createUser |
| 489 |
|
*/ |
| 490 |
|
public function testCreateUserRequiredFieldsEmpty() |
| 491 |
|
{ |
| 492 |
|
$userService = $this->repository->getUserService(); |
| 493 |
|
|
| 494 |
|
$userCreateStruct = $userService->newUserCreateStruct('new_user', '[email protected]', 'password', 'eng-GB'); |
| 495 |
|
$userCreateStruct->setField('first_name', '', 'eng-GB'); |
| 496 |
|
$userCreateStruct->setField('last_name', '', 'eng-GB'); |
| 497 |
|
|
| 498 |
|
$parentGroup = $userService->loadUserGroup(12); |
| 499 |
|
$userService->createUser($userCreateStruct, [$parentGroup]); |
| 500 |
|
} |
| 501 |
|
|
| 502 |
|
/** |
| 503 |
|
* Test creating a user throwing InvalidArgumentException. |
|
@@ 508-518 (lines=11) @@
|
| 505 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
| 506 |
|
* @covers \eZ\Publish\API\Repository\UserService::createUser |
| 507 |
|
*/ |
| 508 |
|
public function testCreateUserThrowsInvalidArgumentException() |
| 509 |
|
{ |
| 510 |
|
$userService = $this->repository->getUserService(); |
| 511 |
|
|
| 512 |
|
$userCreateStruct = $userService->newUserCreateStruct('admin', '[email protected]', 'password', 'eng-GB'); |
| 513 |
|
$userCreateStruct->setField('first_name', '', 'eng-GB'); |
| 514 |
|
$userCreateStruct->setField('last_name', '', 'eng-GB'); |
| 515 |
|
|
| 516 |
|
$parentGroup = $userService->loadUserGroup(12); |
| 517 |
|
$userService->createUser($userCreateStruct, [$parentGroup]); |
| 518 |
|
} |
| 519 |
|
|
| 520 |
|
/** |
| 521 |
|
* Test loading a user. |