public function testRepresentatives() { $response = $this->represent->representatives(); $isJson = self::isJson($response); $this->assertTrue($isJson, 'Failed: representatives() not returning JSON'); $response = $this->represent->representatives('house-of-commons'); $isJson = self::isJson($response); $this->assertTrue($isJson, "Failed: representatives('house-of-commons') not returning JSON"); $response = $this->represent->representatives('house-of-commons', ['point' => '45.524,-73.596']); $isJson = self::isJson($response); $this->assertTrue($isJson, "Failed: representatives('house-of-commons') not returning JSON"); }
function testRepresentatives() { $response = $this->represent->representatives('house-of-commons'); $isJson = $this->isJson($response); $this->assertTrue($isJson, 'Failed: boundaries() not returning JSON'); $decoded = json_decode($response, true); $this->assertArrayHasKey(0, $decoded); $this->assertArrayHasKey('district_name', $decoded[0]); $this->assertArrayHasKey('party_name', $decoded[0]); }