File tree 1 file changed +4
-11
lines changed
tests/dummy/tests/Api/V1/Users
1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change 16
16
17
17
class DeleteTest extends TestCase
18
18
{
19
-
20
19
public function test (): void
21
20
{
22
21
$ user = User::factory ()->createOne ();
23
22
24
- $ expected = $ this ->serializer
25
- ->user ($ user );
26
23
$ response = $ this
27
24
->actingAs (User::factory ()->createOne ())
28
25
->jsonApi ('users ' )
29
- ->delete (url ('/api/v1/users ' , $ expected [ ' id ' ] ));
26
+ ->delete (url ('/api/v1/users ' , $ user ));
30
27
31
- $ response ->assertNotFound ()
32
- ->assertHasError (404 , [
28
+ $ response ->assertNotFound ()->assertErrorStatus ([
33
29
'detail ' => 'not found message ' ,
34
30
'status ' => '404 ' ,
35
31
'title ' => 'Not Found ' ,
@@ -40,14 +36,11 @@ public function testUnauthenticated(): void
40
36
{
41
37
$ user = User::factory ()->createOne ();
42
38
43
- $ expected = $ this ->serializer
44
- ->user ($ user );
45
39
$ response = $ this
46
40
->jsonApi ('users ' )
47
- ->delete (url ('/api/v1/users ' , $ expected [ ' id ' ] ));
41
+ ->delete (url ('/api/v1/users ' , $ user ));
48
42
49
- $ response ->assertNotFound ()
50
- ->assertHasError (404 , [
43
+ $ response ->assertNotFound ()->assertErrorStatus ([
51
44
'detail ' => 'not found message ' ,
52
45
'status ' => '404 ' ,
53
46
'title ' => 'Not Found ' ,
You can’t perform that action at this time.
0 commit comments