diff --git a/tests/Utils/Net.php b/tests/Utils/Net.php index 474811aff9c7d45e9212f1935b8fd6c8c0fd4dbb..2d480f7411af8471427cbf54f6ac7b00ac8a286c 100644 --- a/tests/Utils/Net.php +++ b/tests/Utils/Net.php @@ -13,29 +13,29 @@ class Utils_Net extends PHPUnit_Framework_TestCase public function testIpCIDRcheck() { // check CIDR w/o mask - $this->assertEquals(false, SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0', '127.0.0.1')); + $this->assertFalse(SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0', '127.0.0.1')); // check wrong CIDR w/ mask - $this->assertEquals(false, SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.256/24', '127.0.0.1')); + $this->assertFalse(SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.256/24', '127.0.0.1')); // check wrong IP - $this->assertEquals(false, SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/24', '127.0.0')); - $this->assertEquals(false, SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/24', '127.0.0.*')); + $this->assertTrue(SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/24', '127.0.0')); + $this->assertTrue(SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/24', '127.0.0.*')); // check limits for standard classes - $this->assertEquals(true, SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/24', '127.0.0.0')); - $this->assertEquals(true, SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/24', '127.0.0.255')); - $this->assertEquals(false, SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/24', '127.0.0.256')); + $this->assertTrue(SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/24', '127.0.0.0')); + $this->assertTrue(SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/24', '127.0.0.255')); + $this->assertFalse(SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/24', '127.0.0.256')); - $this->assertEquals(true, SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/16', '127.0.0.0')); - $this->assertEquals(true, SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/16', '127.0.255.255')); - $this->assertEquals(false, SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/16', '127.0.255.256')); - $this->assertEquals(false, SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/16', '127.0.256.255')); + $this->assertTrue(SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/16', '127.0.0.0')); + $this->assertTrue(SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/16', '127.0.255.255')); + $this->assertFalse(SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/16', '127.0.255.256')); + $this->assertFalse(SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/16', '127.0.256.255')); // check limits for non-standard classes - $this->assertEquals(true, SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/23', '127.0.0.0')); - $this->assertEquals(true, SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/23', '127.0.1.255')); - $this->assertEquals(false, SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/23', '127.0.1.256')); - $this->assertEquals(false, SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/23', '127.0.2.0')); + $this->assertTrue(SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/23', '127.0.0.0')); + $this->assertTrue(SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/23', '127.0.1.255')); + $this->assertFalse(SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/23', '127.0.1.256')); + $this->assertFalse(SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/23', '127.0.2.0')); } } \ No newline at end of file