示例#1
0
 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;
 }
示例#2
0
 /**
  * @expectedException \Respect\Validation\Exceptions\AlwaysInvalidException
  */
 public function testAssertShouldThrowExceptionForEmptyInput()
 {
     $validator = new AlwaysInvalid();
     $validator->assert('');
 }