Skip to content

Commit 78724f7

Browse files
committed
test php 7.1
1 parent f2bd096 commit 78724f7

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
sudo: false
21
language: php
32

43
php:
54
- 5.5.9
65
- 5.5
76
- 5.6
87
- 7.0
8+
- 7.1
99
- hhvm
1010

11+
sudo: false
12+
1113
before_script:
1214
- travis_retry composer self-update
1315
- travis_retry composer install --no-interaction --prefer-source

src/Drivers/IPApiDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function get($ip)
1515
{
1616
$data = $this->getRaw($ip);
1717

18-
if (empty($data)) {
18+
if (empty($data) || array_get($data, 'status') === 'fail') {
1919
return $this->getDefault();
2020
}
2121

tests/GeoIPTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,23 @@ public function test_maxmind_web_api_authentication_exception()
103103
$geoip = $geoip->setIp($this->validIp);
104104

105105
$geoip->get();
106+
}
107+
108+
public function test_maxmind_web_api_authentication_exception_getRaw()
109+
{
110+
$config = [
111+
'driver' => 'maxmind',
112+
'maxmind' => [
113+
'user_id' => 'test',
114+
'license_key' => 'test',
115+
],
116+
];
106117

107118
$this->setExpectedException(GeoIPException::class);
108119

120+
$geoip = new GeoIP($config);
121+
$geoip = $geoip->setIp($this->validIp);
122+
109123
$geoip->getRaw();
110124
}
111125

@@ -200,9 +214,23 @@ public function test_ip_api_pro_exception()
200214
$geoip = $geoip->setIp($this->validIp);
201215

202216
$geoip->get();
217+
}
218+
219+
public function test_ip_api_pro_exception_getRaw()
220+
{
221+
$config = [
222+
'driver' => 'ip-api',
223+
'ip-api' => [
224+
'key' => 'test',
225+
'secure' => true,
226+
],
227+
];
203228

204229
$this->setExpectedException(GeoIPException::class);
205230

231+
$geoip = new GeoIP($config);
232+
$geoip = $geoip->setIp($this->validIp);
233+
206234
$geoip->getRaw();
207235
}
208236

0 commit comments

Comments
 (0)