MDL-61169 iplookup: Change to github.com IP
authorAndrew Nicols <andrew@nicols.co.uk>
Mon, 8 Jan 2018 09:13:06 +0000 (17:13 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Mon, 8 Jan 2018 09:15:12 +0000 (17:15 +0800)
iplookup/tests/geoip_test.php
iplookup/tests/geoplugin_test.php

index f6970c4..6f164a7 100644 (file)
@@ -81,17 +81,16 @@ class core_iplookup_geoip_testcase extends advanced_testcase {
     }
 
     public function test_ipv4() {
     }
 
     public function test_ipv4() {
-
-        $result = iplookup_find_location('131.111.150.25');
+        $result = iplookup_find_location('192.30.255.112');
 
         $this->assertEquals('array', gettype($result));
 
         $this->assertEquals('array', gettype($result));
-        $this->assertEquals('Cambridge', $result['city']);
-        $this->assertEquals(0.1167, $result['longitude'], 'Coordinates are out of accepted tolerance', 0.01);
-        $this->assertEquals(52.2, $result['latitude'], 'Coordinates are out of accepted tolerance', 0.01);
+        $this->assertEquals('San Francisco', $result['city']);
+        $this->assertEquals(-122.3933, $result['longitude'], 'Coordinates are out of accepted tolerance', 0.01);
+        $this->assertEquals(37.7697, $result['latitude'], 'Coordinates are out of accepted tolerance', 0.01);
         $this->assertNull($result['error']);
         $this->assertEquals('array', gettype($result['title']));
         $this->assertNull($result['error']);
         $this->assertEquals('array', gettype($result['title']));
-        $this->assertEquals('Cambridge', $result['title'][0]);
-        $this->assertEquals('United Kingdom', $result['title'][1]);
+        $this->assertEquals('San Francisco', $result['title'][0]);
+        $this->assertEquals('United States', $result['title'][1]);
     }
 
     public function test_ipv6() {
     }
 
     public function test_ipv6() {
@@ -110,4 +109,3 @@ class core_iplookup_geoip_testcase extends advanced_testcase {
         $this->assertEquals('United States', $result['title'][1]);
     }
 }
         $this->assertEquals('United States', $result['title'][1]);
     }
 }
-
index 8c94273..864d944 100644 (file)
@@ -46,17 +46,17 @@ class core_iplookup_geoplugin_testcase extends advanced_testcase {
         $CFG->geoipfile = '';
     }
 
         $CFG->geoipfile = '';
     }
 
-    public function test_geoip_ipv4() {
-        $result = iplookup_find_location('131.111.150.25');
+    public function test_ipv4() {
+        $result = iplookup_find_location('192.30.255.112');
 
         $this->assertEquals('array', gettype($result));
 
         $this->assertEquals('array', gettype($result));
-        $this->assertEquals('Cambridge', $result['city']);
-        $this->assertEquals(0.1167, $result['longitude'], '', 0.001);
-        $this->assertEquals(52.200000000000003, $result['latitude'], '', 0.001);
+        $this->assertEquals('San Francisco', $result['city']);
+        $this->assertEquals(-122.3933, $result['longitude'], 'Coordinates are out of accepted tolerance', 0.01);
+        $this->assertEquals(37.7697, $result['latitude'], 'Coordinates are out of accepted tolerance', 0.01);
         $this->assertNull($result['error']);
         $this->assertEquals('array', gettype($result['title']));
         $this->assertNull($result['error']);
         $this->assertEquals('array', gettype($result['title']));
-        $this->assertEquals('Cambridge', $result['title'][0]);
-        $this->assertEquals('United Kingdom', $result['title'][1]);
+        $this->assertEquals('San Francisco', $result['title'][0]);
+        $this->assertEquals('United States', $result['title'][1]);
     }
 
     public function test_geoip_ipv6() {
     }
 
     public function test_geoip_ipv6() {