function testBoundaries() { $response = $this->represent->boundaries('toronto-wards'); $isJson = $this->isJson($response); $this->assertTrue($isJson, 'Failed: boundaries() not returning JSON'); $decoded = json_decode($response, true); $this->assertArrayHasKey(0, $decoded); $this->assertArrayHasKey('boundary_set_name', $decoded[0]); $this->assertArrayHasKey('name', $decoded[0]); $response = $this->represent->boundaries(null, null, false, ['sets' => ['toronto-wards', 'ottawa-wards']]); $isJson = $this->isJson($response); $this->assertTrue($isJson, 'Failed: boundaries() not returning JSON'); $decoded = json_decode($response, true); $this->assertArrayHasKey(0, $decoded); $this->assertArrayHasKey('boundary_set_name', $decoded[0]); $this->assertArrayHasKey('name', $decoded[0]); }
public function testBoundaries() { $response = $this->represent->boundaries(); $isJson = self::isJson($response); $this->assertTrue($isJson, 'Failed: boundaries() not returning JSON'); $response = $this->represent->boundaries('toronto-wards'); $isJson = self::isJson($response); $this->assertTrue($isJson, 'Failed: boundaries(set) not returning JSON'); $response = $this->represent->boundaries('nova-scotia-electoral-districts', 'cape-breton-centre'); $isJson = self::isJson($response); $this->assertTrue($isJson, 'Failed: boundaries(set, name) not returning JSON'); $response = $this->represent->boundaries('nova-scotia-electoral-districts', 'cape-breton-centre', TRUE); $isJson = self::isJson($response); $this->assertTrue($isJson, 'Failed: boundaries(representatives) not returning JSON'); $response = $this->represent->boundaries('census-subdivisions', null, FALSE, ['name' => 'Niagara+Falls']); $isJson = self::isJson($response); $this->assertTrue($isJson, 'Failed: boundaries(params) not returning JSON'); }