Issue #2127487 by chx: GetStringTranslationStub() ignores variables.

8.0.x
Alex Pott 2013-11-06 11:19:40 +00:00
parent 5a9c4bec9c
commit b9dfcae3f9
1 changed files with 1 additions and 1 deletions

View File

@ -177,7 +177,7 @@ abstract class UnitTestCase extends \PHPUnit_Framework_TestCase {
$translation = $this->getMock('Drupal\Core\StringTranslation\TranslationInterface');
$translation->expects($this->any())
->method('translate')
->will($this->returnArgument(0));
->will($this->returnCallback(function ($string, array $args = array()) { return strtr($string, $args); }));
return $translation;
}