use PHPUnit\Framework\TestCase;
use Symfony\Component\Validator\Constraints\Cidr;
use Symfony\Component\Validator\Constraints\Ip;
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Mapping\Loader\AttributeLoader;
class CidrTest extends TestCase
{ public function testForAll() { $cidrConstraint =
new Cidr();
self::
assertEquals(Ip::ALL,
$cidrConstraint->version
);
self::
assertEquals(0,
$cidrConstraint->netmaskMin
);
self::
assertEquals(128,
$cidrConstraint->netmaskMax
);
} public function testForV4() { $cidrConstraint =
new Cidr(['version' => Ip::V4
]);
self::
assertEquals(Ip::V4,
$cidrConstraint->version
);