File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
framework/core/tests/integration/api/users Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,35 @@ public function admin_can_create_user_with_longest_possible_local_part_email()
173173 $ this ->assertEquals ($ email , $ user ->email );
174174 }
175175
176+ /**
177+ * @test
178+ */
179+ public function admin_cannot_create_user_with_invalid_local_part_email ()
180+ {
181+ $ email = str_repeat ('a ' , 65 ) . '@machine.local ' ;
182+
183+ $ response = $ this ->send (
184+ $ this ->request (
185+ 'POST ' ,
186+ '/api/users ' ,
187+ [
188+ 'authenticatedAs ' => 1 ,
189+ 'json ' => [
190+ 'data ' => [
191+ 'attributes ' => [
192+ 'username ' => 'test ' ,
193+ 'password ' => 'too-obscure ' ,
194+ 'email ' => $ email ,
195+ ],
196+ ]
197+ ],
198+ ]
199+ )
200+ );
201+
202+ $ this ->assertEquals (422 , $ response ->getStatusCode ());
203+ }
204+
176205 /**
177206 * @test
178207 */
You can’t perform that action at this time.
0 commit comments