修正单元测试

This commit is contained in:
thinkphp
2016-04-24 14:39:50 +08:00
parent a5b242b2c2
commit ff46880ab4

View File

@@ -314,7 +314,7 @@ EOF;
$this->assertEquals($data, $content); $this->assertEquals($data, $content);
} }
public function testDisplay() public function testFetch()
{ {
$template = new Template(); $template = new Template();
$template->assign('name', 'name'); $template->assign('name', 'name');
@@ -325,11 +325,11 @@ EOF;
'display_cache' => true, 'display_cache' => true,
]; ];
$data = ['name' => 'value']; $data = ['name' => 'value'];
$template->layout('layout')->display('display', $data, $config); $template->layout('layout')->fetch('display', $data, $config);
$this->expectOutputString('value'); $this->expectOutputString('value');
} }
public function testFetch() public function testDisplay()
{ {
$config['view_path'] = dirname(__FILE__) . '/'; $config['view_path'] = dirname(__FILE__) . '/';
$config['view_suffix'] = '.html'; $config['view_suffix'] = '.html';
@@ -382,7 +382,7 @@ value:
php code</div> php code</div>
</nav> </nav>
EOF; EOF;
$template->fetch($content); $template->display($content);
$this->expectOutputString($content2); $this->expectOutputString($content2);
// $template->parse($content); // $template->parse($content);
// var_dump($content); // var_dump($content);