12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace v1;
- include_once('./BaseTests.php');
- class napTest extends BaseTests
- {
- public function testErrorIdNotInteger()
- {
- $client = $this->createClient();
- $client->followRedirects(true);
- $crawler = $client->request('GET', '/api/v1/nap', ['id' => 'a']);
- if ($this->debugTest) {
- var_dump($crawler->filter('body')->text());
- }
- $this->assertEquals(500, $client->getResponse()->getStatusCode());
- }
- public function testErrorIdNotFound()
- {
- $client = $this->createClient();
- $client->followRedirects(true);
- $crawler = $client->request('GET', '/api/v1/nap', []);
- if ($this->debugTest) {
- var_dump($crawler->filter('body')->text());
- }
- $this->assertEquals(500, $client->getResponse()->getStatusCode());
- }
- public function testOk()
- {
- $client = $this->createClient();
- $client->followRedirects(true);
- $crawler = $client->request('GET', '/api/v1/nap', ['id' => '1']);
- if ($this->debugTest) {
- var_dump($crawler->filter('body')->text());
- }
- $this->assertEquals(200, $client->getResponse()->getStatusCode());
- }
- }
|