修正单元测试

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} {/volist}
EOF; EOF;
$template->fetch($content, ['list' => [1, 2, 3, 4, 5]]); $template->display($content, ['list' => [1, 2, 3, 4, 5]]);
$this->expectOutputString('234'); $this->expectOutputString('234');
} }
@@ -100,7 +100,7 @@ EOF;
{\$val} {\$val}
{/foreach} {/foreach}
EOF; EOF;
$template->fetch($content); $template->display($content);
$this->expectOutputString('234'); $this->expectOutputString('234');
} }
@@ -342,7 +342,7 @@ EOF;
{between name=":floor(5.1)" value="1,5"}yes{/between} {between name=":floor(5.1)" value="1,5"}yes{/between}
{notbetween name=":ceil(5.1)" value="1,5"}no{/notbetween} {notbetween name=":ceil(5.1)" value="1,5"}no{/notbetween}
EOF; EOF;
$template->fetch($content); $template->display($content);
$this->expectOutputString('yesno'); $this->expectOutputString('yesno');
} }
@@ -559,17 +559,17 @@ EOF;
{\$i} {\$i}
{/for} {/for}
EOF; EOF;
$template->fetch($content); $template->display($content);
$this->expectOutputString('123456789'); $this->expectOutputString('123456789');
} }
public function testFunction() public function testFunction()
{ {
$template = new template(); $template = new template();
$data = [ $data = [
'list' => ['language' => 'php', 'version' => ['5.4', '5.5']], 'list' => ['language' => 'php', 'version' => ['5.4', '5.5']],
'a' => '[', 'a' => '[',
'b' => ']', 'b' => ']',
]; ];
$content = <<<EOF $content = <<<EOF
@@ -587,7 +587,7 @@ EOF;
{/foreach} {/foreach}
{/function} {/function}
EOF; EOF;
$template->fetch($content, $data); $template->display($content, $data);
$this->expectOutputString("language:php,[5.4][5.5]"); $this->expectOutputString("language:php,[5.4][5.5]");
} }
} }