Skip to content
Snippets Groups Projects
Commit bec4d351 authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Do not use assertEquals(true|false) but assertTrue() or assertFalse() instead.

parent b7bf7242
No related branches found
No related tags found
No related merge requests found
...@@ -13,29 +13,29 @@ class Utils_Net extends PHPUnit_Framework_TestCase ...@@ -13,29 +13,29 @@ class Utils_Net extends PHPUnit_Framework_TestCase
public function testIpCIDRcheck() public function testIpCIDRcheck()
{ {
// check CIDR w/o mask // 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 // 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 // check wrong IP
$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->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.*'));
// check limits for standard classes // check limits for standard classes
$this->assertEquals(true, 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.0'));
$this->assertEquals(true, SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/24', '127.0.0.255')); $this->assertTrue(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->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->assertTrue(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->assertTrue(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->assertFalse(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->assertFalse(SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/16', '127.0.256.255'));
// check limits for non-standard classes // check limits for non-standard classes
$this->assertEquals(true, 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.0.0'));
$this->assertEquals(true, SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/23', '127.0.1.255')); $this->assertTrue(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->assertFalse(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->assertFalse(SimpleSAML_Utils_Net::ipCIDRcheck('127.0.0.0/23', '127.0.2.0'));
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment