File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
+
3
+ declare (strict_types=1 );
4
+
2
5
namespace Tests ;
3
6
7
+ use Codeception \Util \HttpCode ;
4
8
use Tests \Support \ApiTester ;
5
9
6
10
class ApiCest
@@ -20,8 +24,20 @@ public function createUser(ApiTester $I): void
20
24
]
21
25
);
22
26
23
- $ I ->seeResponseCodeIs (201 );
27
+ $ I ->seeResponseCodeIs (HttpCode::CREATED );
28
+ $ I ->seeResponseIsJson ();
29
+ $ I ->seeResponseContains ('username ' );
30
+ }
31
+
32
+ public function getUser (ApiTester $ I ): void
33
+ {
34
+ $ bearerToken = getenv ('API_BEARER_TOKEN ' );
35
+ $ I ->amBearerAuthenticated ($ bearerToken );
36
+ $ I ->sendGet (self ::USERS_URL );
37
+
38
+ $ I ->seeResponseCodeIs (HttpCode::OK );
24
39
$ I ->seeResponseIsJson ();
25
40
$ I ->seeResponseContains ('username ' );
41
+ $ I ->seeResponseContains ('gender ' );
26
42
}
27
43
}
You can’t perform that action at this time.
0 commit comments