public function testGet() { $response = $this->represent->get('representativez'); $this->assertFalse($response, 'Failed: FALSE on 404'); $response = $this->represent->get('representatives'); $isJson = self::isJson($response); $this->assertTrue($isJson, 'Failed: get() not returning JSON'); }
function testGet() { $path = 'boundaries'; $params = ['sets' => ['toronto-wards', 'ottawa-wards']]; $response = $this->represent->get($path, $params); $isJson = $this->isJson($response); $this->assertTrue($isJson, 'Failed: boundaries() not returning JSON'); $decoded = json_decode($response, true); $this->assertArrayHasKey('meta', $decoded); $this->assertArrayHasKey('objects', $decoded); $this->assertInternalType("int", $decoded['meta']['total_count']); $this->assertGreaterThan(1, $decoded['meta']['total_count']); }