Skip to content

Commit

Permalink
test: improve test
Browse files Browse the repository at this point in the history
It was a bit difficult to read the code.
  • Loading branch information
kenjis committed Sep 22, 2022
1 parent 1c59d14 commit eafb028
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/system/View/ParserFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,15 @@ public function testRound()
$parser = new Parser($this->config, $this->viewsDir, $this->loader);

$data = [
'value1' => 5.55,
'value1' => 5.555,
];

$template = '{ value1|round(1) } { value1|round(1, common) } { value1|round(ceil) } { value1|round(floor) } { value1|round(unknown) }';
$template = '{ value1|round(1) } / { value1|round(1, common) }'
. ' / { value1|round(ceil) } / { value1|round(floor) }'
. ' / { value1|round(unknown) }';

$parser->setData($data);
$this->assertSame('5.6 5.6 6 5 5.55', $parser->renderString($template));
$this->assertSame('5.6 / 5.6 / 6 / 5 / 5.555', $parser->renderString($template));
}

public function testStripTags()
Expand Down

0 comments on commit eafb028

Please sign in to comment.