mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
修正单元测试
This commit is contained in:
@@ -60,7 +60,7 @@ EOF;
|
||||
{/volist}
|
||||
EOF;
|
||||
|
||||
$template->fetch($content, ['list' => [1, 2, 3, 4, 5]]);
|
||||
$template->display($content, ['list' => [1, 2, 3, 4, 5]]);
|
||||
$this->expectOutputString('234');
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ EOF;
|
||||
{\$val}
|
||||
{/foreach}
|
||||
EOF;
|
||||
$template->fetch($content);
|
||||
$template->display($content);
|
||||
$this->expectOutputString('234');
|
||||
}
|
||||
|
||||
@@ -342,7 +342,7 @@ EOF;
|
||||
{between name=":floor(5.1)" value="1,5"}yes{/between}
|
||||
{notbetween name=":ceil(5.1)" value="1,5"}no{/notbetween}
|
||||
EOF;
|
||||
$template->fetch($content);
|
||||
$template->display($content);
|
||||
$this->expectOutputString('yesno');
|
||||
}
|
||||
|
||||
@@ -559,17 +559,17 @@ EOF;
|
||||
{\$i}
|
||||
{/for}
|
||||
EOF;
|
||||
$template->fetch($content);
|
||||
$template->display($content);
|
||||
$this->expectOutputString('123456789');
|
||||
}
|
||||
|
||||
public function testFunction()
|
||||
{
|
||||
$template = new template();
|
||||
$data = [
|
||||
$data = [
|
||||
'list' => ['language' => 'php', 'version' => ['5.4', '5.5']],
|
||||
'a' => '[',
|
||||
'b' => ']',
|
||||
'a' => '[',
|
||||
'b' => ']',
|
||||
];
|
||||
|
||||
$content = <<<EOF
|
||||
@@ -587,7 +587,7 @@ EOF;
|
||||
{/foreach}
|
||||
{/function}
|
||||
EOF;
|
||||
$template->fetch($content, $data);
|
||||
$template->display($content, $data);
|
||||
$this->expectOutputString("language:php,[5.4][5.5]");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user