for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace OpCacheGUITest\Unit\Network\Ip;
use OpCacheGUI\Network\Ip\Converter;
use OpCacheGUI\Network\Ip\Single;
use PHPUnit\Framework\TestCase;
class SingleTest extends TestCase
{
/**
*/
public function testConstructCorrectInstance()
$ipRange = new Single();
$this->assertInstanceOf(Converter::class, $ipRange);
}
* @covers OpCacheGUI\Network\Ip\Single::isValid
public function testIsValidValid()
$this->assertTrue($ipRange->isValid('127.0.0.1'));
public function testIsValidNotValidCidr()
$this->assertFalse($ipRange->isValid('127.0.0.1/32'));
public function testIsValidNotValidRange()
$this->assertFalse($ipRange->isValid('10.0.0.1-10.0.0.5'));
public function testIsValidNotValidLocalhost()
$this->assertFalse($ipRange->isValid('localhost'));
public function testIsValidNotValidWildcard()
$this->assertFalse($ipRange->isValid('10.0.0.*'));
* @covers OpCacheGUI\Network\Ip\Single::convert
public function testConvert()
$this->assertSame([2130706433.0, 2130706433.0], $ipRange->convert('127.0.0.1'));