Skip to content

Commit 4d8a51f

Browse files
committed
Add test for #8250
Add tests ensuring {0} works at the end of a message string.
1 parent bec7fea commit 4d8a51f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/TestCase/I18n/I18nTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,18 @@ public function testBasicDomainFunction()
251251
$package = new Package('default');
252252
$package->setMessages([
253253
'Cow' => 'Le moo',
254-
'The {0} is tasty' => 'The {0} is delicious'
254+
'The {0} is tasty' => 'The {0} is delicious',
255+
'Average price {0}' => 'Price Average {0}',
255256
]);
256257
return $package;
257258
});
259+
$this->assertEquals('Le moo', __d('custom', 'Cow'));
260+
258261
$result = __d('custom', 'The {0} is tasty', ['fruit']);
259262
$this->assertEquals('The fruit is delicious', $result);
263+
264+
$result = __d('custom', 'Average price {0}', ['9.99']);
265+
$this->assertEquals('Price Average 9.99', $result);
260266
}
261267

262268
/**

0 commit comments

Comments
 (0)