|
@@ 10-19 (lines=10) @@
|
| 7 |
|
{ |
| 8 |
|
protected static $fixture_file = 'RatingApiControllerTest.yml'; |
| 9 |
|
|
| 10 |
|
public function testErrorWhenMissingParams() |
| 11 |
|
{ |
| 12 |
|
$response = $this->get('api/rating'); |
| 13 |
|
|
| 14 |
|
$this->assertJson($response->getBody()); |
| 15 |
|
|
| 16 |
|
$result = json_decode($response->getBody()); |
| 17 |
|
$this->assertFalse($result->success); |
| 18 |
|
$this->assertContains('Missing', $result->message); |
| 19 |
|
} |
| 20 |
|
|
| 21 |
|
public function testErrorWhenModuleNotFound() |
| 22 |
|
{ |
|
@@ 21-30 (lines=10) @@
|
| 18 |
|
$this->assertContains('Missing', $result->message); |
| 19 |
|
} |
| 20 |
|
|
| 21 |
|
public function testErrorWhenModuleNotFound() |
| 22 |
|
{ |
| 23 |
|
$response = $this->get('api/rating/bar/baz'); |
| 24 |
|
|
| 25 |
|
$this->assertJson($response->getBody()); |
| 26 |
|
|
| 27 |
|
$result = json_decode($response->getBody()); |
| 28 |
|
$this->assertFalse($result->success); |
| 29 |
|
$this->assertContains('not be found', $result->message); |
| 30 |
|
} |
| 31 |
|
|
| 32 |
|
public function testResponseIncludesRating() |
| 33 |
|
{ |