Merge pull request #745 from pquerner/unittests/564
Add UnitTests for #679
This commit is contained in:
@@ -109,6 +109,20 @@ class ValidateTest extends TestCase
|
|||||||
$this->assertEquals("8.8.8.8/128.0.0.0", $result);
|
$this->assertEquals("8.8.8.8/128.0.0.0", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testValidateIPv6()
|
||||||
|
{
|
||||||
|
$result = Validate::is_ipv6('1.1.1.1/4');
|
||||||
|
$this->assertFalse($result);
|
||||||
|
$result = Validate::is_ipv6('1.1.1.1');
|
||||||
|
$this->assertFalse($result);
|
||||||
|
$result = Validate::is_ipv6('::ffff:10.20.30.40');
|
||||||
|
$this->assertEquals('::ffff:10.20.30.40', $result);
|
||||||
|
$result = Validate::is_ipv6('2620:0:2d0:200::7/32');
|
||||||
|
$this->assertFalse($result);
|
||||||
|
$result = Validate::is_ipv6('2620:0:2d0:200::7');
|
||||||
|
$this->assertEquals('2620:0:2d0:200::7', $result);
|
||||||
|
}
|
||||||
|
|
||||||
public function testValidateIpLocalhostAllowedWrongIp()
|
public function testValidateIpLocalhostAllowedWrongIp()
|
||||||
{
|
{
|
||||||
$this->expectException("Exception");
|
$this->expectException("Exception");
|
||||||
|
|||||||
Reference in New Issue
Block a user