diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2018-10-18 23:34:18 +0200 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2018-10-30 22:50:22 +0100 |
commit | b443b53919f50bd0176e7b67dfd1efc28276a770 (patch) | |
tree | df4d089d9d431f5223a71e6b40f9d87361705929 /tests/Unit/HelpersTest.php | |
parent | 90e1a949623ead173c0952f802d7b5c5487251b1 (diff) |
Translation: added pluralization support
Diffstat (limited to 'tests/Unit/HelpersTest.php')
-rw-r--r-- | tests/Unit/HelpersTest.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/Unit/HelpersTest.php b/tests/Unit/HelpersTest.php index b9cedd30..b36abc64 100644 --- a/tests/Unit/HelpersTest.php +++ b/tests/Unit/HelpersTest.php @@ -219,6 +219,26 @@ class HelpersTest extends TestCase } /** + * @covers \_e + */ + public function testTranslatePlural() + { + /** @var Translator|MockObject $translator */ + $translator = $this->getMockBuilder(Translator::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->getAppMock('translator', $translator); + + $translator->expects($this->once()) + ->method('translatePlural') + ->with('One: %u', 'Multiple: %u', 4, [4]) + ->willReturn('Multiple: 4'); + + $this->assertEquals('Multiple: 4', _e('One: %u', 'Multiple: %u', 4, [4])); + } + + /** * @covers \url */ public function testUrl() |