@@ 31-43 (lines=13) @@ | ||
28 | ], $response); |
|
29 | } |
|
30 | ||
31 | public function testUserLogoutWithGetRequest() |
|
32 | { |
|
33 | // send the HTTP request |
|
34 | $response = $this->endpoint('get@logout')->makeCall(); |
|
35 | ||
36 | // assert response status is correct |
|
37 | $this->assertEquals('405', $response->getStatusCode()); |
|
38 | ||
39 | // assert message is correct |
|
40 | $this->assertResponseContainKeyValue([ |
|
41 | 'message' => '405 Method Not Allowed', |
|
42 | ], $response); |
|
43 | } |
|
44 | ||
45 | public function testUserLogoutWithoutToken() |
|
46 | { |
|
@@ 45-57 (lines=13) @@ | ||
42 | ], $response); |
|
43 | } |
|
44 | ||
45 | public function testUserLogoutWithoutToken() |
|
46 | { |
|
47 | // send the HTTP request |
|
48 | $response = $this->auth(false)->makeCall(); |
|
49 | ||
50 | // assert response status is correct |
|
51 | $this->assertEquals('401', $response->getStatusCode()); |
|
52 | ||
53 | // assert message is correct |
|
54 | $this->assertResponseContainKeyValue([ |
|
55 | 'message' => 'Failed to authenticate because of bad credentials or an invalid authorization header.', |
|
56 | ], $response); |
|
57 | } |
|
58 | } |
|
59 | ||
@@ 17-29 (lines=13) @@ | ||
14 | ||
15 | protected $endpoint = 'post@logout'; |
|
16 | ||
17 | public function testUserLogout_() |
|
18 | { |
|
19 | // send the HTTP request |
|
20 | $response = $this->makeCall(); |
|
21 | ||
22 | // assert response status is correct |
|
23 | $this->assertEquals('202', $response->getStatusCode()); |
|
24 | ||
25 | // assert message is correct |
|
26 | $this->assertResponseContainKeyValue([ |
|
27 | 'message' => 'User Logged Out Successfully.', |
|
28 | ], $response); |
|
29 | } |
|
30 | ||
31 | public function testUserLogoutWithGetRequest() |
|
32 | { |
@@ 59-73 (lines=15) @@ | ||
56 | } |
|
57 | ||
58 | ||
59 | public function testUpdateExistingUserWithEmptyValues() |
|
60 | { |
|
61 | $data = []; // empty data |
|
62 | ||
63 | // send the HTTP request |
|
64 | $response = $this->makeCall($data); |
|
65 | ||
66 | // assert response status is correct |
|
67 | $this->assertEquals('417', $response->getStatusCode()); |
|
68 | ||
69 | // assert message is correct |
|
70 | $this->assertResponseContainKeyValue([ |
|
71 | 'message' => 'Inputs are empty.', |
|
72 | ], $response); |
|
73 | } |
|
74 | } |
|
75 |