Exemplo n.º 1
0
 /**
  * @param string $trimmedKey
  *
  * @return string
  */
 private function getReplaceValue($trimmedKey)
 {
     if (array_key_exists($trimmedKey, $this->allVars) && is_scalar($this->allVars[$trimmedKey])) {
         $value = $this->allVars[$trimmedKey];
     } else {
         $value = $this->templateBuilder->getReplaceValue($trimmedKey, $this->allVars);
     }
     $this->usedVars[$trimmedKey] = $value;
     return $value;
 }
Exemplo n.º 2
0
 /**
  * @dataProvider replaceValueProvider
  * @cover        DmMailer\Service\TemplateBuilder
  *
  * @param string $trimmedKey
  * @param mixed  $expectedResult
  */
 public function testReplaceValue($trimmedKey, $expectedResult)
 {
     $actualResult = $this->sut->getReplaceValue($trimmedKey, $this->getAllVars());
     $this->assertEquals($expectedResult, $actualResult);
 }