/** * The method calls to the delivery half of the plugin to get the * geo information * * @return array An array that will contain the results of the * GeoTargeting lookup. */ function getGeoInfo($useCookie = false) { return Plugin_geoTargeting_oxMaxMindGeoIP_oxMaxMindGeoIP_Delivery_getGeoInfo($useCookie); }
function testGetGeoInfo_IspDb() { $conf =& $GLOBALS['_MAX']['CONF']; // Test with a supplied GeoIP ISP database $ispFile = $conf['oxMaxMindGeoIP']['geoipIspLocation']; if (file_exists($ispFile)) { $conf['oxMaxMindGeoIP']['geoipCountryLocation'] = ''; $conf['oxMaxMindGeoIP']['geoipRegionLocation'] = ''; $conf['oxMaxMindGeoIP']['geoipCityLocation'] = ''; $conf['oxMaxMindGeoIP']['geoipAreaLocation'] = ''; $conf['oxMaxMindGeoIP']['geoipDmaLocation'] = ''; $conf['oxMaxMindGeoIP']['geoipOrgLocation'] = ''; $conf['oxMaxMindGeoIP']['geoipIspLocation'] = $ispFile; $conf['oxMaxMindGeoIP']['geoipNetspeedLocation'] = ''; $result = Plugin_geoTargeting_oxMaxMindGeoIP_oxMaxMindGeoIP_Delivery_getGeoInfo(false); $this->assertequal($result['country_code'], 'US'); $this->assertNull($result['region']); $this->assertNull($result['city']); $this->assertNull($result['postal_code']); $this->assertNull($result['latitude']); $this->assertNull($result['longitude']); $this->assertNull($result['dma_code']); $this->assertNull($result['area_code']); $this->assertEqual($result['organisation'], 'Road Runner'); $this->assertNull($result['isp']); $this->assertNull($result['netspeed']); } }