示例#1
0
 /**
  * Use this method in KeyValueValidator::validate to regist errors that will then mark as unvalid the current validator itself.
  * @param string $errorMessage The error message 
  */
 protected function registerError($errorMessage)
 {
     $errorMessageCompiled = PlaceHolderResolver::resolvePlaceHolder($errorMessage, $this->kv->getValue());
     $this->parcel->addRawError(new Error($this->kv->getKey(), $this->kv->getValue(), $errorMessageCompiled));
 }
示例#2
0
 public function testReplace()
 {
     $result = PlaceHolderResolver::resolvePlaceHolder($this->str, self::RV);
     $this->assertEquals($result, self::MESSAGE_BEGIN . self::RV . self::MESSAGE_END);
 }