@@ -153,7 +153,7 @@ public function test8()
153153 $ this ->assertTrue ($ status );
154154
155155 $ 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 ' );
157157 $ this ->assertTrue ($ status );
158158
159159
@@ -166,7 +166,7 @@ public function test8()
166166
167167
168168 $ 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 ' );
170170 $ this ->assertFalse ($ status );
171171 }
172172
@@ -193,15 +193,36 @@ public function test9()
193193 /**
194194 * @test
195195 */
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.. ' );
199201 $ this ->assertTrue ($ range );
200202
201- $ range = Ip::matchRange ('192.168.1.200 ' ,'192.168.1. ' );
203+ $ range = Ip::matchRange ('192.168.1.200 ' , '192.168.1. ' );
202204 $ this ->assertTrue ($ range );
203205
204- $ range = Ip::matchRange ('192.168.1.200 ' ,'192.168.2. ' );
206+ $ range = Ip::matchRange ('192.168.1.200 ' , '192.168.2. ' );
205207 $ this ->assertFalse ($ range );
206208 }
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+
207228}
0 commit comments