Fix #1174 Add number_shorten() function and 'shorten' template filter

This commit is contained in:
Kijin Sung 2019-07-27 21:33:30 +09:00
parent 4f20f0e8c1
commit 72577ce6bb
4 changed files with 73 additions and 0 deletions

View file

@ -399,6 +399,14 @@ class TemplateHandlerTest extends \Codeception\TestCase\Test
'<p>{$foo|format:2}</p>',
'?><p><?php echo number_format($__Context->foo, \'2\') ?></p>'
),
array(
'<p>{$foo|shorten}</p>',
'?><p><?php echo number_shorten($__Context->foo) ?></p>'
),
array(
'<p>{$foo|shorten:2}</p>',
'?><p><?php echo number_shorten($__Context->foo, \'2\') ?></p>'
),
array(
'<p>{$foo|date:His}</p>',
'?><p><?php echo getDisplayDateTime(ztime($__Context->foo), \'His\') ?></p>'