/** * Test the faster geo call */ public function testGeoDetails() { $ipinfo = new Ipinfo(); $expected = new Host(array("city" => "Mountain View", "country" => "US", "ip" => "8.8.8.8", "loc" => "37.3860,-122.0838", "postal" => "94035", "region" => "California", "hostname" => "", "org" => "", "phone" => "")); $actual = $ipinfo->getIpGeoDetails("8.8.8.8"); $this->assertEquals($expected, $actual); }
/** * Test in debug mode. */ public function testDebugMode() { $ipinfo = new Ipinfo(array('debug' => true)); $expected = 'Mountain View'; $actual = $ipinfo->getSpecificField('8.8.8.8', Ipinfo::CITY); $this->assertEquals($expected, $actual); }