mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-48766 tests: move from Liberec to Cambridge
(liberec ip seemed to have been identified as a new location nearby now, hoping cambridge will be stable)
This commit is contained in:
parent
0ddc7e5582
commit
c307689792
@ -82,16 +82,16 @@ class core_iplookup_geoip_testcase extends advanced_testcase {
|
||||
|
||||
public function test_ipv4() {
|
||||
|
||||
$result = iplookup_find_location('147.230.16.1');
|
||||
$result = iplookup_find_location('131.111.150.25');
|
||||
|
||||
$this->assertEquals('array', gettype($result));
|
||||
$this->assertEquals('Liberec', $result['city']);
|
||||
$this->assertEquals(15.0653, $result['longitude'], '', 0.001);
|
||||
$this->assertEquals(50.7639, $result['latitude'], '', 0.001);
|
||||
$this->assertEquals('Cambridge', $result['city']);
|
||||
$this->assertEquals(0.1249, $result['longitude'], '', 0.001);
|
||||
$this->assertEquals(52.191000000000003, $result['latitude'], '', 0.001);
|
||||
$this->assertNull($result['error']);
|
||||
$this->assertEquals('array', gettype($result['title']));
|
||||
$this->assertEquals('Liberec', $result['title'][0]);
|
||||
$this->assertEquals('Czech Republic', $result['title'][1]);
|
||||
$this->assertEquals('Cambridge', $result['title'][0]);
|
||||
$this->assertEquals('United Kingdom', $result['title'][1]);
|
||||
}
|
||||
|
||||
public function test_ipv6() {
|
||||
|
@ -47,16 +47,16 @@ class core_iplookup_geoplugin_testcase extends advanced_testcase {
|
||||
}
|
||||
|
||||
public function test_geoip_ipv4() {
|
||||
$result = iplookup_find_location('147.230.16.1');
|
||||
$result = iplookup_find_location('131.111.150.25');
|
||||
|
||||
$this->assertEquals('array', gettype($result));
|
||||
$this->assertEquals('Liberec', $result['city']);
|
||||
$this->assertEquals(15.0653, $result['longitude'], '', 0.001);
|
||||
$this->assertEquals(50.7639, $result['latitude'], '', 0.001);
|
||||
$this->assertEquals('Cambridge', $result['city']);
|
||||
$this->assertEquals(0.1167, $result['longitude'], '', 0.001);
|
||||
$this->assertEquals(52.200000000000003, $result['latitude'], '', 0.001);
|
||||
$this->assertNull($result['error']);
|
||||
$this->assertEquals('array', gettype($result['title']));
|
||||
$this->assertEquals('Liberec', $result['title'][0]);
|
||||
$this->assertEquals('Czech Republic', $result['title'][1]);
|
||||
$this->assertEquals('Cambridge', $result['title'][0]);
|
||||
$this->assertEquals('United Kingdom', $result['title'][1]);
|
||||
}
|
||||
|
||||
public function test_geoip_ipv6() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user