1414use Api \User \Entity \User ;
1515use Api \User \Entity \UserRole ;
1616use Api \User \Repository \UserRepository ;
17+ use Fig \Http \Message \StatusCodeInterface ;
1718use Laminas \Diactoros \ServerRequest ;
18- use Laminas \Http \Response ;
1919use Mezzio \Authentication \UserInterface ;
2020use Mezzio \Authorization \AuthorizationInterface ;
2121use PHPUnit \Framework \MockObject \Exception ;
@@ -62,7 +62,7 @@ public function testAuthorizationInvalidClientIdProvided(): void
6262 $ this ->request = $ this ->request ->withAttribute (UserInterface::class, $ identity );
6363
6464 $ response = $ this ->subject ->process ($ this ->request , $ this ->handler );
65- $ this ->assertSame (Response:: STATUS_CODE_403 , $ response ->getStatusCode ());
65+ $ this ->assertSame (StatusCodeInterface:: STATUS_FORBIDDEN , $ response ->getStatusCode ());
6666
6767 $ data = json_decode ($ response ->getBody ()->getContents (), true );
6868 $ this ->assertArrayHasKey ('error ' , $ data );
@@ -82,7 +82,7 @@ public function testAuthorizationInactiveAdmin(): void
8282 $ this ->request = $ this ->request ->withAttribute (UserInterface::class, $ identity );
8383
8484 $ response = $ this ->subject ->process ($ this ->request , $ this ->handler );
85- $ this ->assertSame (Response:: STATUS_CODE_403 , $ response ->getStatusCode ());
85+ $ this ->assertSame (StatusCodeInterface:: STATUS_FORBIDDEN , $ response ->getStatusCode ());
8686
8787 $ data = json_decode ($ response ->getBody ()->getContents (), true );
8888 $ this ->assertArrayHasKey ('error ' , $ data );
@@ -98,7 +98,7 @@ public function testAuthorizationInactiveUser(): void
9898 $ this ->request = $ this ->request ->withAttribute (UserInterface::class, $ identity );
9999
100100 $ response = $ this ->subject ->process ($ this ->request , $ this ->handler );
101- $ this ->assertSame (Response:: STATUS_CODE_403 , $ response ->getStatusCode ());
101+ $ this ->assertSame (StatusCodeInterface:: STATUS_FORBIDDEN , $ response ->getStatusCode ());
102102
103103 $ data = json_decode ($ response ->getBody ()->getContents (), true );
104104 $ this ->assertArrayHasKey ('error ' , $ data );
@@ -116,7 +116,7 @@ public function testAuthorizationUserNotFoundOrDeleted(): void
116116 $ this ->request = $ this ->request ->withAttribute (UserInterface::class, $ identity );
117117
118118 $ response = $ this ->subject ->process ($ this ->request , $ this ->handler );
119- $ this ->assertSame (Response:: STATUS_CODE_403 , $ response ->getStatusCode ());
119+ $ this ->assertSame (StatusCodeInterface:: STATUS_FORBIDDEN , $ response ->getStatusCode ());
120120
121121 $ data = json_decode ($ response ->getBody ()->getContents (), true );
122122 $ this ->assertArrayHasKey ('error ' , $ data );
@@ -139,7 +139,7 @@ public function testAuthorizationNotGranted(): void
139139 $ this ->request = $ this ->request ->withAttribute (UserInterface::class, $ identity );
140140
141141 $ response = $ this ->subject ->process ($ this ->request , $ this ->handler );
142- $ this ->assertSame (Response:: STATUS_CODE_403 , $ response ->getStatusCode ());
142+ $ this ->assertSame (StatusCodeInterface:: STATUS_FORBIDDEN , $ response ->getStatusCode ());
143143
144144 $ data = json_decode ($ response ->getBody ()->getContents (), true );
145145 $ this ->assertArrayHasKey ('error ' , $ data );
0 commit comments