Skip to content

Commit 162828c

Browse files
committed
Fix tests after rebase
1 parent d963f44 commit 162828c

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

tests/IPinfoTest.php

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@ public function testGetBatchDetails()
205205
$this->assertEquals($res['8.8.8.8/hostname'], 'dns.google');
206206
$ipV4 = $res['4.4.4.4'];
207207
$this->assertEquals($ipV4['ip'], '4.4.4.4');
208-
$this->assertEquals($ipV4['city'], 'Monroe');
209-
$this->assertEquals($ipV4['region'], 'Louisiana');
210-
$this->assertEquals($ipV4['country'], 'US');
211-
$this->assertEquals($ipV4['loc'], '32.5530,-92.0422');
212-
$this->assertEquals($ipV4['postal'], '71203');
213-
$this->assertEquals($ipV4['timezone'], 'America/Chicago');
208+
$this->assertEquals($ipV4['city'], 'Dhaka');
209+
$this->assertEquals($ipV4['region'], 'Dhaka Division');
210+
$this->assertEquals($ipV4['country'], 'BD');
211+
$this->assertEquals($ipV4['loc'], '23.7104,90.4074');
212+
$this->assertEquals($ipV4['postal'], '1000');
213+
$this->assertEquals($ipV4['timezone'], 'Asia/Dhaka');
214214
$this->assertEquals($ipV4['org'], 'AS3356 Level 3 Parent, LLC');
215215
}
216216
}
@@ -225,23 +225,23 @@ public function testNetworkDetails()
225225
$h = new IPinfo($tok);
226226
$res = $h->getDetails('AS123');
227227

228-
if ($res['error'] === "Token does not have access to this API") {
228+
if ($res->error === "Token does not have access to this API") {
229229
$this->markTestSkipped('Token does not have access to this API');
230230
}
231231

232-
$this->assertEquals($res['asn'], 'AS123');
233-
$this->assertEquals($res['name'], 'Air Force Systems Networking');
234-
$this->assertEquals($res['country'], 'US');
235-
$this->assertEquals($res['allocated'], '1987-08-24');
236-
$this->assertEquals($res['registry'], 'arin');
237-
$this->assertEquals($res['domain'], 'af.mil');
238-
$this->assertEquals($res['num_ips'], 0);
239-
$this->assertEquals($res['type'], 'inactive');
240-
$this->assertEquals($res['prefixes'], []);
241-
$this->assertEquals($res['prefixes6'], []);
242-
$this->assertEquals($res['peers'], null);
243-
$this->assertEquals($res['upstreams'], null);
244-
$this->assertEquals($res['downstreams'], null);
232+
$this->assertEquals($res->asn, 'AS123');
233+
$this->assertEquals($res->name, 'Air Force Systems Networking');
234+
$this->assertEquals($res->country, 'US');
235+
$this->assertEquals($res->allocated, '1987-08-24');
236+
$this->assertEquals($res->registry, 'arin');
237+
$this->assertEquals($res->domain, 'af.mil');
238+
$this->assertEquals($res->num_ips, 0);
239+
$this->assertEquals($res->type, 'inactive');
240+
$this->assertEquals($res->prefixes, []);
241+
$this->assertEquals($res->prefixes6, []);
242+
$this->assertEquals($res->peers, null);
243+
$this->assertEquals($res->upstreams, null);
244+
$this->assertEquals($res->downstreams, null);
245245
}
246246

247247
public function testBogonLocal4()
@@ -298,11 +298,11 @@ public function testIPv6DifferentNotations()
298298
$standard_ip = "2607:00:4005:805::200e";
299299
$standard_result = $h->getDetails($standard_ip);
300300
$this->assertEquals($standard_result->ip, '2607:00:4005:805::200e');
301-
$this->assertEquals($standard_result->city, 'Killarney');
302-
$this->assertEquals($standard_result->region, 'Manitoba');
301+
$this->assertEquals($standard_result->city, 'Langenburg');
302+
$this->assertEquals($standard_result->region, 'Saskatchewan');
303303
$this->assertEquals($standard_result->country, 'CA');
304-
$this->assertEquals($standard_result->loc, '49.1833,-99.6636');
305-
$this->assertEquals($standard_result->timezone, 'America/Winnipeg');
304+
$this->assertEquals($standard_result->loc, '50.8500,-101.7176');
305+
$this->assertEquals($standard_result->timezone, 'America/Regina');
306306

307307
// Various notations of the same IPv6 address
308308
$variations = [

0 commit comments

Comments
 (0)