mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-15 05:45:33 +08:00
Added GridView message check to FallbackMessageFormatterTest
This commit is contained in:
@@ -160,6 +160,14 @@ _MSG_
|
||||
$result = $formatter->fallbackFormat($pattern, [], 'en-US');
|
||||
$this->assertEquals($pattern, $result, $formatter->getErrorMessage());
|
||||
}
|
||||
|
||||
public function testGridViewMessage()
|
||||
{
|
||||
$pattern = 'Showing <b>{begin, number}-{end, number}</b> of <b>{totalCount, number}</b> {totalCount, plural, one{item} other{items}}.';
|
||||
$formatter = new FallbackMessageFormatter();
|
||||
$result = $formatter->fallbackFormat($pattern, ['begin' => 1, 'end' => 5, 'totalCount' => 10], 'en-US');
|
||||
$this->assertEquals('Showing <b>1-5</b> of <b>10</b> items.', $result);
|
||||
}
|
||||
}
|
||||
|
||||
class FallbackMessageFormatter extends MessageFormatter
|
||||
|
||||
Reference in New Issue
Block a user