File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 5454 );
5555});
5656
57+ test ('ipstack should return default when response is empty ' , function () {
58+ $ config = [
59+ 'driver ' => 'ipstack ' ,
60+ 'ipstack ' => [
61+ 'key ' => 'test ' ,
62+ ],
63+ ];
64+
65+ $ client = Mockery::mock (Client::class);
66+
67+ $ client ->shouldReceive ('get ' )
68+ ->times (1 )
69+ ->andReturn (
70+ new Response (
71+ 200 ,
72+ [],
73+ json_encode ([])
74+ )
75+ );
76+
77+ $ geoip = new GeoIP ($ config , $ client );
78+ $ geoip = $ geoip ->setIp ($ this ->validIp );
79+
80+ expect ($ geoip ->get ())->toEqual (
81+ [
82+ 'city ' => null ,
83+ 'country ' => null ,
84+ 'countryCode ' => null ,
85+ 'latitude ' => null ,
86+ 'longitude ' => null ,
87+ 'region ' => null ,
88+ 'regionCode ' => null ,
89+ 'timezone ' => null ,
90+ 'postalCode ' => null ,
91+ ]
92+ );
93+ });
94+
5795test ('ipstack throws exception getraw ' , function () {
5896 $ config = [
5997 'driver ' => 'ipstack ' ,
108146
109147 $ geoip ->get ();
110148});
149+
111150test ('ipstack respects false secure config value ' , function () {
112151 $ config = [
113152 'driver ' => 'ipstack ' ,
135174
136175 $ geoip ->get ();
137176});
177+
138178test ("ipstack respects true secure config value " , function () {
139179 $ config = [
140180 'driver ' => 'ipstack ' ,
You can’t perform that action at this time.
0 commit comments