Skip to content

Commit

Permalink
add some basic unit tests for IPv6CIDR, should hopefully bring to cov…
Browse files Browse the repository at this point in the history
…erage up
  • Loading branch information
Sam Stenvall committed Nov 18, 2016
1 parent e6cdaf6 commit e90086d
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions tests/Definition/IPv6CIDRTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

/**
* Test for IPv4CIDR
*
* @author Sam Stenvall <[email protected]>
* @copyright Copyright &copy; Sam Stenvall 2016-
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
*/
class IPv6CIDRTest extends DefinitionTest
{


/**
* @expectedException InvalidArgumentException
*/
public function testEmptyDefinition()
{
new \Whitelist\Definition\IPv6CIDR('');
}


/**
* @expectedException InvalidArgumentException
*/
public function testValidate()
{
$cidr = new \Whitelist\Definition\IPv6CIDR('2001::/129');

$this->assertFalse($cidr->validate());
}


/**
*
*/
public function testValidateTrue() {
$cidr = new \Whitelist\Definition\IPv6CIDR('2001::/3');

$this->assertTrue($cidr->validate());
}

}

0 comments on commit e90086d

Please sign in to comment.