Ejemplo n.º 1
0
 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");
 }
Ejemplo n.º 2
0
 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]);
 }