mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
This commit is contained in:
committed by
Tony Murray
parent
a9ad228be4
commit
ed02e39347
@@ -83,4 +83,14 @@ class CommonFunctionsTest extends \PHPUnit_Framework_TestCase
|
||||
$data = 'Toner, S/N:CR_UM-16021314488.';
|
||||
$this->assertEquals('Toner, S/N CR_UM-16021314488.', safedescr($data));
|
||||
}
|
||||
|
||||
public function testIsIp()
|
||||
{
|
||||
$this->assertTrue(is_ip('192.168.0.1'));
|
||||
$this->assertTrue(is_ip('192.168.0.1', 'ipv4'));
|
||||
$this->assertTrue(is_ip('2001:4860:4860::8888', 'ipv6'));
|
||||
$this->assertFalse(is_ip('2001:4860:4860::8888', 'ipv4'));
|
||||
$this->assertFalse(is_ip('192.168.0.1', 'ipv6'));
|
||||
$this->assertFalse(is_ip('not_an_ip'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user