validateAttribute() публичный Метод

public validateAttribute ( $model, $attribute )
Пример #1
0
 /**
  * @depends testValidate
  */
 public function testAllowMessageFromRule()
 {
     $model = FakedValidationModel::createWithAttributes(['attr_one' => ['text']]);
     $validator = new EachValidator(['rule' => ['integer']]);
     $validator->allowMessageFromRule = true;
     $validator->validateAttribute($model, 'attr_one');
     $this->assertContains('integer', $model->getFirstError('attr_one'));
     $model->clearErrors();
     $validator->allowMessageFromRule = false;
     $validator->validateAttribute($model, 'attr_one');
     $this->assertNotContains('integer', $model->getFirstError('attr_one'));
 }