public function testGetCountry3() { $countries = new Countries(); $results = $countries->getCountry('Vatican'); $this->assertEquals('VA', $results['iso2']); $results = $countries->getCountry('Lao People\'s Democratic Republic'); $this->assertEquals('LA', $results['iso2']); }
public function testConstruction() { $countries = new Countries(); $dataSet = (include 'dataSet.php'); foreach ($dataSet as $term => $desired) { $result = $countries->getCountry($term); $msg = '"%s" was expecting iso "%s" but got "%s" for "%s"'; $msg = sprintf($msg, $term, $desired, $result['iso2'], $result['name']); $this->assertEquals($desired, $result['iso2'], $msg); } }