-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f22073
commit 81fc1d3
Showing
3 changed files
with
20 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,8 +40,8 @@ class UserCreateActionTest extends TestCase | |
* @dataProvider \App\Test\Provider\User\UserCreateProvider::userCreateAuthorizationCases() | ||
* | ||
* @param array $authenticatedUserAttr authenticated user attributes containing the user_role_id | ||
* @param UserRole $newUserRole user role id of new user | ||
* @param array $expectedResult HTTP status code, bool if db_entry_created and json_response | ||
* @param UserRole|null $newUserRole user role id of new user | ||
* @param array $expectedResult HTTP status code, bool if db entry is created and json_response | ||
* | ||
* @return void | ||
*/ | ||
|
@@ -63,7 +63,9 @@ public function testUserSubmitCreateAuthorization( | |
'email' => '[email protected]', | ||
'password' => '12345678', | ||
'password2' => '12345678', | ||
'user_role_id' => $newUserRole ? $userRoleFinderRepository->findUserRoleIdByName($newUserRole->value) : $newUserRole, | ||
'user_role_id' => $newUserRole ? $userRoleFinderRepository->findUserRoleIdByName( | ||
$newUserRole->value | ||
) : $newUserRole, | ||
'status' => 'unverified', | ||
'language' => 'en_US', | ||
]; | ||
|
@@ -168,7 +170,7 @@ public function testUserSubmitCreateInvalid(array $requestBody, array $jsonRespo | |
$response = $this->app->handle($request); | ||
// Assert 422 Unprocessable Entity, which means validation error if request body contains user_role_id | ||
// even if it's an empty string | ||
self::assertSame(StatusCodeInterface::STATUS_UNPROCESSABLE_ENTITY, $response->getStatusCode()); | ||
self::assertSame(StatusCodeInterface::STATUS_UNPROCESSABLE_ENTITY, $response->getStatusCode()); | ||
|
||
|
||
// Database must be unchanged - only one row (authenticated user) expected in user table | ||
|
@@ -177,10 +179,7 @@ public function testUserSubmitCreateInvalid(array $requestBody, array $jsonRespo | |
} | ||
|
||
/** | ||
* Test that user with same email as existing user cannot be created. | ||
* | ||
* @throws ContainerExceptionInterface | ||
* @throws NotFoundExceptionInterface | ||
* Test that user with the same email as existing user cannot be created. | ||
* | ||
* @return void | ||
*/ | ||
|