validate() public method

public validate ( )
Beispiel #1
0
 public function validate()
 {
     parent::validate();
     $this->validateTrue(!empty($this->userIds), 'Select players');
 }
Beispiel #2
0
 public function validateAssociated(Validatable $validatable)
 {
     $validatable->validate();
     $this->_errors = array_merge($this->getErrorObjects(), $validatable->getErrorObjects());
     $this->_errorFields = array_merge($this->_errorFields, $validatable->getErrorFields());
 }
 public function validate()
 {
     parent::validate();
     $this->validateUnique($this->values, "error");
 }
Beispiel #4
0
 /**
  * @test
  */
 public function shouldClearErrorBeforeValidation()
 {
     // given
     $validatable = new Validatable();
     $validatable->validateAssociated(new ValidatableChild(array('error'), array('errorField')));
     // when
     $validatable->validate();
     // then
     $this->assertEmpty($validatable->getErrors());
     $this->assertEmpty($validatable->getErrorFields());
 }