Conditions | 1 |
Paths | 1 |
Total Lines | 26 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | public function auth(AcceptanceTester $I): void |
||
14 | { |
||
15 | $I->haveHttpHeader('Content-Type', 'application/json'); |
||
16 | $I->sendPOST( |
||
17 | '/auth/', |
||
18 | [ |
||
19 | 'login' => 'Opal1144', |
||
20 | 'password' => 'Opal1144', |
||
21 | ] |
||
22 | ); |
||
23 | $I->seeResponseCodeIs(HttpCode::OK); |
||
24 | $I->seeResponseIsJson(); |
||
25 | $I->seeResponseContainsJson( |
||
26 | [ |
||
27 | 'status' => 'success', |
||
28 | 'error_message' => '', |
||
29 | 'error_code' => null, |
||
30 | ] |
||
31 | ); |
||
32 | |||
33 | $response = Json::decode($I->grabResponse()); |
||
34 | $I->seeInDatabase( |
||
35 | 'user', |
||
36 | [ |
||
37 | 'id' => 1, |
||
38 | 'token' => $response['data']['token'], |
||
39 | ] |
||
101 |