Skip to content

Commit cd1ee5d

Browse files
committed
fix tests
1 parent 61b79df commit cd1ee5d

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ Next add the following to the `aliases` array in your `config/app.php`
4747

4848
Next run `php artisan vendor:publish --provider="PulkitJalan\GeoIP\GeoIPServiceProvider" --tag="config"` to publish the config file.
4949

50-
#### Looking for a Laravel 4 compatible version?
50+
#### Using an older version of PHP / Laravel?
5151

52-
Checkout the [1.0 branch](https://github.com/pulkitjalan/geoip/tree/1.0)
52+
If you are on a PHP version below 7.2 or a Laravel version below 5.8 just use an older version of this package.
5353

5454
## Usage
5555

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
}
1111
],
1212
"require": {
13-
"php": ">=7.0",
14-
"illuminate/support": "~5|~6",
15-
"illuminate/console": "~5|~6",
16-
"guzzlehttp/guzzle": "~6",
17-
"geoip2/geoip2": "^2.0"
13+
"php": "^7.2",
14+
"illuminate/support": "~5.8.0|^6.0",
15+
"illuminate/console": "~5.8.0|^6.0",
16+
"guzzlehttp/guzzle": "^6.3",
17+
"geoip2/geoip2": "^2.9"
1818
},
1919
"require-dev": {
2020
"phpunit/phpunit": "^8.3",

tests/GeoIPTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Mockery;
66
use BadMethodCallException;
7+
use Illuminate\Support\Arr;
78
use PulkitJalan\GeoIP\GeoIP;
89
use PHPUnit\Framework\TestCase;
910
use PulkitJalan\GeoIP\Exceptions\GeoIPException;
@@ -255,13 +256,11 @@ public function test_ip_api()
255256
$geoip = new GeoIP($config);
256257
$geoip = $geoip->setIp($this->validIp);
257258

258-
$this->assertEquals($geoip->getCountry(), 'United States');
259+
$this->assertEquals($geoip->getCountry(), 'United Kingdom');
259260

260261
$geoip = $geoip->setIp($this->invalidIp);
261262

262-
$this->assertArraySubset([
263-
'status' => 'fail',
264-
], $geoip->getRaw());
263+
$this->assertEquals('fail', Arr::get($geoip->getRaw(), 'status'));
265264

266265
$this->assertEquals([
267266
'city' => null,

0 commit comments

Comments
 (0)