From 67c36ffe4bd35b887c40e348e7d774d9e6a012ae Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Sat, 25 Feb 2012 14:45:20 +0000 Subject: tests for mga_geoip and downloads --- lib/t/01_mga_geoip.t | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lib/t/01_mga_geoip.t (limited to 'lib/t/01_mga_geoip.t') diff --git a/lib/t/01_mga_geoip.t b/lib/t/01_mga_geoip.t new file mode 100644 index 000000000..a33a708a7 --- /dev/null +++ b/lib/t/01_mga_geoip.t @@ -0,0 +1,28 @@ + array('FR', 'EU'), + + '2a00:1450:8006::93' + => array('IE', 'EU'), + + '173.194.67.99' + => array('US', 'NA'), + + '46.33.75.17' + => array('DE', 'EU') +); + +foreach ($ips as $ip => $cc) { + is($country = mga_geoip_country_by_ip($ip, false), $cc[0], 'country match for ' . $ip); + is(mga_geoip_continent_by_country($country), $cc[1], 'continent match for ' . $ip); +} + -- cgit v1.2.1