@@ 9-16 (lines=8) @@ | ||
6 | ||
7 | class AlertControllerTest extends \PHPUnit_Framework_TestCase |
|
8 | { |
|
9 | public function testAlertReturnsCorrectNonEmptyHttpCode() |
|
10 | { |
|
11 | $client = new Client(); |
|
12 | $response = $client->request('GET', 'http://192.168.33.10/ps2alerts-api/public/v2/alerts/10000'); |
|
13 | ||
14 | $this->assertEquals(200, $response->getStatusCode()); |
|
15 | $data = json_decode($response->getBody(true), true); |
|
16 | } |
|
17 | ||
18 | public function testAlertHandlesEmptyData() |
|
19 | { |
|
@@ 37-44 (lines=8) @@ | ||
34 | $this->assertArrayHasKey('message', $data['error']); |
|
35 | } |
|
36 | ||
37 | public function testAlertReturnsBody() |
|
38 | { |
|
39 | $client = new Client(); |
|
40 | $response = $client->request('GET', 'http://192.168.33.10/ps2alerts-api/public/v2/alerts/10000'); |
|
41 | ||
42 | $this->assertEquals(200, $response->getStatusCode()); |
|
43 | $data = json_decode($response->getBody(true), true); |
|
44 | } |
|
45 | ||
46 | public function testAlertReturnsJsonHeaders() |
|
47 | { |