@@ -153,7 +153,7 @@ public function test8()
153
153
$ this ->assertTrue ($ status );
154
154
155
155
$ status = Ip::match ('2001:cdba:0000:0000:0000:0000:3257:9652 ' ,
156
- '2001:cdba:0000:0000:0000:0000:3257:1234-2001:cdba:0000:0000:0000:0000:3257:9999 ' );
156
+ '2001:cdba:0000:0000:0000:0000:3257:1234-2001:cdba:0000:0000:0000:0000:3257:9999 ' );
157
157
$ this ->assertTrue ($ status );
158
158
159
159
@@ -166,7 +166,7 @@ public function test8()
166
166
167
167
168
168
$ status = Ip::match ('2001:cdba:0000:0000:0000:0000:3257:7778 ' ,
169
- '2001:cdba:0000:0000:0000:0000:3257:1234-2001:cdba:0000:0000:0000:0000:3257:7777 ' );
169
+ '2001:cdba:0000:0000:0000:0000:3257:1234-2001:cdba:0000:0000:0000:0000:3257:7777 ' );
170
170
$ this ->assertFalse ($ status );
171
171
}
172
172
@@ -193,15 +193,36 @@ public function test9()
193
193
/**
194
194
* @test
195
195
*/
196
-
197
- public function test_match_range (){
198
- $ range = Ip::matchRange ('192.168.100. ' ,'192.168.. ' );
196
+
197
+
198
+ public function test_match_range ()
199
+ {
200
+ $ range = Ip::matchRange ('192.168.100. ' , '192.168.. ' );
199
201
$ this ->assertTrue ($ range );
200
202
201
- $ range = Ip::matchRange ('192.168.1.200 ' ,'192.168.1. ' );
203
+ $ range = Ip::matchRange ('192.168.1.200 ' , '192.168.1. ' );
202
204
$ this ->assertTrue ($ range );
203
205
204
- $ range = Ip::matchRange ('192.168.1.200 ' ,'192.168.2. ' );
206
+ $ range = Ip::matchRange ('192.168.1.200 ' , '192.168.2. ' );
205
207
$ this ->assertFalse ($ range );
206
208
}
209
+
210
+ public function testLocal ()
211
+ {
212
+ $ status = Ip::isLocal ('192.168.5.5 ' );
213
+ $ this ->assertTrue ($ status );
214
+
215
+ $ status = Ip::isLocal ('fe80::202:b3ff:fe1e:8329 ' );
216
+ $ this ->assertTrue ($ status );
217
+ }
218
+
219
+ /**
220
+ * @test
221
+ */
222
+ public function testRemote ()
223
+ {
224
+ $ status = Ip::isRemote ('8.8.8.8 ' );
225
+ $ this ->assertTrue ($ status );
226
+ }
227
+
207
228
}
0 commit comments