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