Browse Source

Add test for #8250

Add tests ensuring {0} works at the end of a message string.
Mark Story 10 years ago
parent
commit
4d8a51f035
1 changed files with 7 additions and 1 deletions
  1. 7 1
      tests/TestCase/I18n/I18nTest.php

+ 7 - 1
tests/TestCase/I18n/I18nTest.php

@@ -251,12 +251,18 @@ class I18nTest extends TestCase
             $package = new Package('default');
             $package->setMessages([
                 'Cow' => 'Le moo',
-                'The {0} is tasty' => 'The {0} is delicious'
+                'The {0} is tasty' => 'The {0} is delicious',
+                'Average price {0}' => 'Price Average {0}',
             ]);
             return $package;
         });
+        $this->assertEquals('Le moo', __d('custom', 'Cow'));
+
         $result = __d('custom', 'The {0} is tasty', ['fruit']);
         $this->assertEquals('The fruit is delicious', $result);
+
+        $result = __d('custom', 'Average price {0}', ['9.99']);
+        $this->assertEquals('Price Average 9.99', $result);
     }
 
     /**