File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -113,4 +113,34 @@ public function testLookup()
113113 $ this ->assertEquals ($ res ->abuse ['phone ' ], '+1-650-253-0000 ' );
114114 $ this ->assertEquals ($ res ->domains ['ip ' ], '8.8.8.8 ' );
115115 }
116+
117+ public function testTimeoutOverride ()
118+ {
119+ $ tok = getenv ('IPINFO_TOKEN ' );
120+ if (!$ tok ) {
121+ $ this ->markTestSkipped ('IPINFO_TOKEN env var required ' );
122+ }
123+
124+ $ h = new IPinfo ($ tok , ['timeout ' => 0.1 ]);
125+ $ ip = "8.8.8.8 " ;
126+
127+ $ this ->expectException (IPinfoException::class);
128+ $ res = $ h ->getDetails ($ ip );
129+ }
130+
131+ public function testGuzzleOverride ()
132+ {
133+ $ tok = getenv ('IPINFO_TOKEN ' );
134+ if (!$ tok ) {
135+ $ this ->markTestSkipped ('IPINFO_TOKEN env var required ' );
136+ }
137+
138+ $ h = new IPinfo ($ tok , ['guzzle_opts ' => [
139+ 'timeout ' => 0.1
140+ ]]);
141+ $ ip = "8.8.8.8 " ;
142+
143+ $ this ->expectException (IPinfoException::class);
144+ $ res = $ h ->getDetails ($ ip );
145+ }
116146}
You can’t perform that action at this time.
0 commit comments