public function testFieldValidationReturnsTrue()
 {
     $fields = ['name', 'address', 'country'];
     $this->validator->setExpectedFields($fields);
     $data = ['name' => 'Gaurav', 'address' => 'Somewhere', 'country' => 'UK'];
     $this->validator->setData($data);
     $validate = $this->validator->validateFields();
     $this->assertTrue($validate);
 }
Пример #2
0
 /**
  * @param array $fields
  * @param array $data
  * @return bool
  */
 public function validateFields(array $fields, array $data)
 {
     $this->fieldValidator->setExpectedFields($fields);
     $this->fieldValidator->setData($data);
     return $this->fieldValidator->validateFields();
 }