forked from Jalle19/php-whitelist-check
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add some basic unit tests for IPv6CIDR, should hopefully bring to cov…
…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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 © 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()); | ||
} | ||
|
||
} |