/** * Class constructor. * @param string $expectedType the values expected type * @throws \InvalidArgumentException if an argument is not valid. */ public function __construct($expectedType) { Assert::isString($expectedType); parent::__construct("is_" . strtolower($expectedType)); }
/** * Class constructor. * @param string $expectedType the values expected type * @throws \InvalidArgumentException if an argument is not valid. */ public function __construct($expectedType) { Assert::isString($expectedType); parent::__construct("ctype_" . $expectedType); }
/** * @covers Brickoo\Component\Validation\Constraint\FunctionCallbackConstraint::__construct * @covers Brickoo\Component\Validation\Constraint\FunctionCallbackConstraint::matches */ public function testAssertionOfOneValueFails() { $functionCallbackConstraint = new FunctionCallbackConstraint("is_integer"); $this->assertFalse($functionCallbackConstraint->matches("failure !!!")); }