123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <?php
- namespace v1;
- class napsTest extends BaseTests
- {
- public function testErrorIdNotInteger()
- {
- $client = $this->createClient();
- $client->followRedirects(true);
- $crawler = $client->request('GET', '/api/v1/naps', ['filters[id]' => 'a']);
- if ($this->debugTest) {
- var_dump($crawler->filter('body')->text());
- }
- $this->assertEquals(500, $client->getResponse()->getStatusCode());
- }
- public function testErrorParentNotInteger()
- {
- $client = $this->createClient();
- $client->followRedirects(true);
- $crawler = $client->request('GET', '/api/v1/naps', ['filters[parent]' => 'a']);
- if ($this->debugTest) {
- var_dump($crawler->filter('body')->text());
- }
- $this->assertEquals(500, $client->getResponse()->getStatusCode());
- }
- public function testErrorOltNotInteger()
- {
- $client = $this->createClient();
- $client->followRedirects(true);
- $crawler = $client->request('GET', '/api/v1/naps', ['filters[olt]' => 'a']);
- if ($this->debugTest) {
- var_dump($crawler->filter('body')->text());
- }
- $this->assertEquals(500, $client->getResponse()->getStatusCode());
- }
- public function testErrorTenancyIdNotInteger()
- {
- $client = $this->createClient();
- $client->followRedirects(true);
- $crawler = $client->request('GET', '/api/v1/naps', ['filters[tenancyId]' => 'a']);
- if ($this->debugTest) {
- var_dump($crawler->filter('body')->text());
- }
- $this->assertEquals(500, $client->getResponse()->getStatusCode());
- }
- public function testErrorCriteriaNotInteger()
- {
- $client = $this->createClient();
- $client->followRedirects(true);
- $crawler = $client->request('GET', '/api/v1/naps', ['filters[qb-criteria]' => 'a']);
- if ($this->debugTest) {
- var_dump($crawler->filter('body')->text());
- }
- $this->assertEquals(500, $client->getResponse()->getStatusCode());
- }
- public function testOkId()
- {
- $client = $this->createClient();
- $client->followRedirects(true);
- $crawler = $client->request('GET', '/api/v1/naps', ['filters[id]' => 1]);
- if ($this->debugTest) {
- var_dump($crawler->filter('body')->text());
- }
- $this->assertEquals(200, $client->getResponse()->getStatusCode());
- }
- public function testOkParent()
- {
- $client = $this->createClient();
- $client->followRedirects(true);
- $crawler = $client->request('GET', '/api/v1/naps', ['filters[parent]' => 1]);
- if ($this->debugTest) {
- var_dump($crawler->filter('body')->text());
- }
- $this->assertEquals(200, $client->getResponse()->getStatusCode());
- }
- public function testOkOlt()
- {
- $client = $this->createClient();
- $client->followRedirects(true);
- $crawler = $client->request('GET', '/api/v1/naps', ['filters[olt]' => 1]);
- if ($this->debugTest) {
- var_dump($crawler->filter('body')->text());
- }
- $this->assertEquals(200, $client->getResponse()->getStatusCode());
- }
- public function testOkTenancyId()
- {
- $client = $this->createClient();
- $client->followRedirects(true);
- $crawler = $client->request('GET', '/api/v1/naps', ['filters[tenancyId]' => 1]);
- if ($this->debugTest) {
- var_dump($crawler->filter('body')->text());
- }
- $this->assertEquals(200, $client->getResponse()->getStatusCode());
- }
- }
|