From 189e808c8a8190f6b966e6fb05a1cb3a78333330 Mon Sep 17 00:00:00 2001 From: Maxime Curioni Date: Tue, 22 Jul 2025 19:46:47 -0600 Subject: [PATCH 1/2] Run "Unit tests" Github Actions on PR and pushes for `master` branch --- .github/workflows/phpunit.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index a550a29..364fbed 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -1,7 +1,12 @@ name: Unit Tests on: + push: + branches: + - master pull_request: + branches: + - master permissions: contents: read From f852832e357516e6780add43c505cc0aeb738341 Mon Sep 17 00:00:00 2001 From: Maxime Curioni Date: Tue, 22 Jul 2025 19:52:54 -0600 Subject: [PATCH 2/2] Update tests --- tests/IPinfoTest.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/IPinfoTest.php b/tests/IPinfoTest.php index 5d870ec..75d0c6f 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, '37.4056,-122.0775'); - $this->assertEquals($res->latitude, '37.4056'); - $this->assertEquals($res->longitude, '-122.0775'); + $this->assertEquals($res->loc, '38.0088,-122.1175'); + $this->assertEquals($res->latitude, '38.0088'); + $this->assertEquals($res->longitude, '-122.1175'); $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'], 'Dhaka'); - $this->assertEquals($ipV4['region'], 'Dhaka Division'); - $this->assertEquals($ipV4['country'], 'BD'); - $this->assertEquals($ipV4['loc'], '23.7104,90.4074'); - $this->assertEquals($ipV4['postal'], '1000'); - $this->assertEquals($ipV4['timezone'], 'Asia/Dhaka'); + $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->assertEquals($ipV4['org'], 'AS3356 Level 3 Parent, LLC'); } }