public function __construct($when, Validatable $then, Validatable $else = null) { $this->when = $when; $this->then = $then; if (null === $else) { $else = new AlwaysInvalid(); $else->setTemplate(AlwaysInvalidException::SIMPLE); } $this->else = $else; }
/** * @expectedException \Respect\Validation\Exceptions\AlwaysInvalidException */ public function testAssertShouldThrowExceptionForEmptyInput() { $validator = new AlwaysInvalid(); $validator->assert(''); }