/** * Validates one key-value pair * * @param string $key * @param mixed $value */ public function validateOne($key, $value) { $result = $this->validator->runField($key, array($key => $value)); if ($result->isValid() === false) { throw new InvalidArgumentException($result->getError($key)); } }
public function testRunFieldFailure() { $this->assertFalse($this->object->runField('email', array())->isValid()); }