Skip to content

Commit

Permalink
Merge branch 'MDL-56740-master' of git://github.com/danpoltawski/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Nov 4, 2016
2 parents ac67c97 + 2fe28e0 commit 79322e0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions iplookup/tests/geoip_test.php
Expand Up @@ -95,17 +95,19 @@ public function test_ipv4() {
}

public function test_ipv6() {
// NOTE: these tests can be altered by the geoip dataset, there has been an attempt to get
// a 'reliable' result.

$result = iplookup_find_location('2a01:8900:2:3:8c6c:c0db:3d33:9ce6');
$result = iplookup_find_location('2607:f010:3fe:fff1::ff:fe00:25');

$this->assertEquals('array', gettype($result));
$this->assertEquals('Lancaster', $result['city']);
$this->assertEquals(-2.7997, $result['longitude'], 'Coordinates are out of accepted tolerance', 0.01);
$this->assertEquals(54.0465, $result['latitude'], 'Coordinates are out of accepted tolerance', 0.01);
$this->assertEquals('Los Angeles', $result['city']);
$this->assertEquals(-118.2987, $result['longitude'], 'Coordinates are out of accepted tolerance', 0.01);
$this->assertEquals(33.7866, $result['latitude'], 'Coordinates are out of accepted tolerance', 0.01);
$this->assertNull($result['error']);
$this->assertEquals('array', gettype($result['title']));
$this->assertEquals('Lancaster', $result['title'][0]);
$this->assertEquals('United Kingdom', $result['title'][1]);
$this->assertEquals('Los Angeles', $result['title'][0]);
$this->assertEquals('United States', $result['title'][1]);
}
}

0 comments on commit 79322e0

Please sign in to comment.