use Symfony\Component\Validator\Exception\InvalidArgumentException;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Mapping\Loader\AttributeLoader;
/**
* @author Renan Taranto <renantaranto@gmail.com>
*/
class IpTest extends TestCase
{ public function testNormalizerCanBeSet() { $ip =
new Ip(['normalizer' => 'trim'
]);
$this->
assertEquals('trim',
$ip->normalizer
);
} public function testInvalidNormalizerThrowsException() { $this->
expectException(InvalidArgumentException::
class);
$this->
expectExceptionMessage('The "normalizer" option must be a valid callable ("string" given).'
);
new Ip(['normalizer' => 'Unknown Callable'
]);
}