@@ -33,7 +33,7 @@ public function cidr_with_different_masks_works()
3333 public function multiple_ips_in_whitelist_work ()
3434 {
3535 $ whitelist = ['127.0.0.1 ' , '192.168.1.0/24 ' , '10.0.0.1 ' ];
36-
36+
3737 $ this ->assertTrue (IpHelper::isIpAllowed ('127.0.0.1 ' , $ whitelist ));
3838 $ this ->assertTrue (IpHelper::isIpAllowed ('192.168.1.50 ' , $ whitelist ));
3939 $ this ->assertTrue (IpHelper::isIpAllowed ('10.0.0.1 ' , $ whitelist ));
@@ -70,15 +70,15 @@ public function empty_blacklist_returns_false()
7070 public function parse_ip_list_from_string ()
7171 {
7272 $ result = IpHelper::parseIpList ('127.0.0.1,192.168.1.1,10.0.0.0/8 ' );
73-
73+
7474 $ this ->assertEquals (['127.0.0.1 ' , '192.168.1.1 ' , '10.0.0.0/8 ' ], $ result );
7575 }
7676
7777 /** @test */
7878 public function parse_ip_list_handles_spaces ()
7979 {
8080 $ result = IpHelper::parseIpList ('127.0.0.1, 192.168.1.1 , 10.0.0.0/8 ' );
81-
81+
8282 $ this ->assertEquals (['127.0.0.1 ' , '192.168.1.1 ' , '10.0.0.0/8 ' ], $ result );
8383 }
8484
@@ -107,10 +107,9 @@ public function cidr_edge_cases()
107107 // /32 should match only exact IP
108108 $ this ->assertTrue (IpHelper::isIpAllowed ('192.168.1.1 ' , ['192.168.1.1/32 ' ]));
109109 $ this ->assertFalse (IpHelper::isIpAllowed ('192.168.1.2 ' , ['192.168.1.1/32 ' ]));
110-
110+
111111 // /0 should match everything (entire IPv4 range)
112112 $ this ->assertTrue (IpHelper::isIpAllowed ('0.0.0.0 ' , ['0.0.0.0/0 ' ]));
113113 $ this ->assertTrue (IpHelper::isIpAllowed ('255.255.255.255 ' , ['0.0.0.0/0 ' ]));
114114 }
115115}
116-
0 commit comments