File tree Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 1- sudo : false
21language : php
32
43php :
54 - 5.5.9
65 - 5.5
76 - 5.6
87 - 7.0
8+ - 7.1
99 - hhvm
1010
11+ sudo : false
12+
1113before_script :
1214 - travis_retry composer self-update
1315 - travis_retry composer install --no-interaction --prefer-source
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments