修正单元测试

This commit is contained in:
thinkphp
2016-04-24 16:15:10 +08:00
parent df8a027c63
commit d0ad5f6beb

View File

@@ -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]");
}
}