| @@ 11-16 (lines=6) @@ | ||
| 8 | ||
| 9 | class GeneratedRestControllerTest extends BaseTestGeneratedRestController { |
|
| 10 | ||
| 11 | public function testGetsAction() { |
|
| 12 | $this->client->request('GET', '/orders.json'); |
|
| 13 | $this->assertEquals("200", $this->client->getResponse()->getStatusCode()); |
|
| 14 | $content = json_decode($this->client->getResponse()->getContent()); |
|
| 15 | $this->assertEquals(2, count($content)); |
|
| 16 | } |
|
| 17 | ||
| 18 | public function testGetsActionWithFilterOnTotalPrice() { |
|
| 19 | $filter = json_encode(array( |
|
| @@ 40-45 (lines=6) @@ | ||
| 37 | $this->assertEquals('Invoice 1', $content[1]['name']); |
|
| 38 | } |
|
| 39 | ||
| 40 | public function testGetsActionWithStart() { |
|
| 41 | $this->client->request('GET', '/orders.json?start=1'); |
|
| 42 | $this->assertEquals("200", $this->client->getResponse()->getStatusCode()); |
|
| 43 | $content = json_decode($this->client->getResponse()->getContent(), true); |
|
| 44 | $this->assertEquals(1, count($content)); |
|
| 45 | } |
|
| 46 | ||
| 47 | public function testGetsActionWithLimit() { |
|
| 48 | $this->client->request('GET', '/orders.json?limit=1'); |
|
| @@ 47-52 (lines=6) @@ | ||
| 44 | $this->assertEquals(1, count($content)); |
|
| 45 | } |
|
| 46 | ||
| 47 | public function testGetsActionWithLimit() { |
|
| 48 | $this->client->request('GET', '/orders.json?limit=1'); |
|
| 49 | $this->assertEquals("200", $this->client->getResponse()->getStatusCode()); |
|
| 50 | $content = json_decode($this->client->getResponse()->getContent(), true); |
|
| 51 | $this->assertEquals(1, count($content)); |
|
| 52 | } |
|
| 53 | ||
| 54 | public function testGetsActionWithPage() { |
|
| 55 | $this->client->request('GET', '/orders.json?page=2'); |
|
| @@ 10-15 (lines=6) @@ | ||
| 7 | ||
| 8 | class GeneratedRestControllerTest extends BaseTestGeneratedRestController { |
|
| 9 | ||
| 10 | public function testGetsAction() { |
|
| 11 | $this->client->request('GET', '/cars.json'); |
|
| 12 | $this->assertEquals("200", $this->client->getResponse()->getStatusCode()); |
|
| 13 | $content = json_decode($this->client->getResponse()->getContent()); |
|
| 14 | $this->assertEquals(3, count($content)); |
|
| 15 | } |
|
| 16 | ||
| 17 | public function testGetsActionWithFilterOnName() { |
|
| 18 | $filter = json_encode(array( |
|
| @@ 69-74 (lines=6) @@ | ||
| 66 | $this->assertEquals('Toyota', $content[0]['name']); |
|
| 67 | } |
|
| 68 | ||
| 69 | public function testGetsActionWithStart() { |
|
| 70 | $this->client->request('GET', '/cars.json?start=1'); |
|
| 71 | $this->assertEquals("200", $this->client->getResponse()->getStatusCode()); |
|
| 72 | $content = json_decode($this->client->getResponse()->getContent(), true); |
|
| 73 | $this->assertEquals(2, count($content)); |
|
| 74 | } |
|
| 75 | ||
| 76 | public function testGetsActionWithLimit() { |
|
| 77 | $this->client->request('GET', '/cars.json?limit=1'); |
|
| @@ 76-81 (lines=6) @@ | ||
| 73 | $this->assertEquals(2, count($content)); |
|
| 74 | } |
|
| 75 | ||
| 76 | public function testGetsActionWithLimit() { |
|
| 77 | $this->client->request('GET', '/cars.json?limit=1'); |
|
| 78 | $this->assertEquals("200", $this->client->getResponse()->getStatusCode()); |
|
| 79 | $content = json_decode($this->client->getResponse()->getContent(), true); |
|
| 80 | $this->assertEquals(1, count($content)); |
|
| 81 | } |
|
| 82 | ||
| 83 | public function testGetsActionWithPage() { |
|
| 84 | $this->client->request('GET', '/cars.json?page=2'); |
|