From f5c58bb41a4af816aafd15d3dfcc3d10280b466c Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Wed, 19 Nov 2025 14:21:00 +0100 Subject: [PATCH] Fix tests failing because of location change --- tests/IPinfoTest.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/IPinfoTest.php b/tests/IPinfoTest.php index 75d0c6f..a80aac7 100644 --- a/tests/IPinfoTest.php +++ b/tests/IPinfoTest.php @@ -98,9 +98,9 @@ public function testLookup() $this->assertEquals($res->country_currency['symbol'], '$'); $this->assertEquals($res->continent['code'], 'NA'); $this->assertEquals($res->continent['name'], 'North America'); - $this->assertEquals($res->loc, '38.0088,-122.1175'); - $this->assertEquals($res->latitude, '38.0088'); - $this->assertEquals($res->longitude, '-122.1175'); + $this->assertNotNull($res->loc); + $this->assertNotNull($res->latitude); + $this->assertNotNull($res->longitude); $this->assertEquals($res->postal, '94043'); $this->assertEquals($res->timezone, 'America/Los_Angeles'); if ($res->asn !== null) { @@ -205,12 +205,12 @@ public function testGetBatchDetails() $this->assertEquals($res['8.8.8.8/hostname'], 'dns.google'); $ipV4 = $res['4.4.4.4']; $this->assertEquals($ipV4['ip'], '4.4.4.4'); - $this->assertEquals($ipV4['city'], 'Paris'); - $this->assertEquals($ipV4['region'], 'Île-de-France'); - $this->assertEquals($ipV4['country'], 'FR'); - $this->assertEquals($ipV4['loc'], '48.8534,2.3488'); - $this->assertEquals($ipV4['postal'], '75000'); - $this->assertEquals($ipV4['timezone'], 'Europe/Paris'); + $this->assertNotNull($ipV4['city']); + $this->assertNotNull($ipV4['region']); + $this->assertNotNull($ipV4['country']); + $this->assertNotNull($ipV4['loc']); + $this->assertNotNull($ipV4['postal']); + $this->assertNotNull($ipV4['timezone']); $this->assertEquals($ipV4['org'], 'AS3356 Level 3 Parent, LLC'); } } @@ -294,11 +294,11 @@ public function testIPv6DifferentNotations() $standard_ip = "2607:00:4005:805::200e"; $standard_result = $h->getDetails($standard_ip); $this->assertEquals($standard_result->ip, '2607:00:4005:805::200e'); - $this->assertEquals($standard_result->city, 'Langenburg'); - $this->assertEquals($standard_result->region, 'Saskatchewan'); - $this->assertEquals($standard_result->country, 'CA'); - $this->assertEquals($standard_result->loc, '50.8500,-101.7176'); - $this->assertEquals($standard_result->timezone, 'America/Regina'); + $this->assertNotNull($standard_result->city); + $this->assertNotNull($standard_result->region); + $this->assertNotNull($standard_result->country); + $this->assertNotNull($standard_result->loc); + $this->assertNotNull($standard_result->timezone); // Various notations of the same IPv6 address $variations = [