调整template相关test case

This commit is contained in:
Gaozhen Ying
2017-10-26 20:17:43 +08:00
parent 0ba3eb1c9c
commit 4005af6f26
11 changed files with 318 additions and 314 deletions

View File

@@ -40,13 +40,13 @@ class Foo extends Controller
public function fetchTest()
{
$template = dirname(__FILE__) . '/display.html';
$template = APP_PATH . 'views' . DS .'display.html';
return $this->fetch($template, ['name' => 'ThinkPHP']);
}
public function displayTest()
{
$template = dirname(__FILE__) . '/display.html';
$template = APP_PATH . 'views' . DS .'display.html';
return $this->display($template, ['name' => 'ThinkPHP']);
}
public function test()
@@ -161,7 +161,7 @@ class controllerTest extends \PHPUnit_Framework_TestCase
{
$controller = new Foo(Request::instance());
$view = $this->getView($controller);
$template = dirname(__FILE__) . '/display.html';
$template = APP_PATH . 'views' . DS .'display.html';
$viewFetch = $view->fetch($template, ['name' => 'ThinkPHP']);
$this->assertEquals($controller->fetchTest(), $viewFetch);
}
@@ -170,7 +170,7 @@ class controllerTest extends \PHPUnit_Framework_TestCase
{
$controller = new Foo;
$view = $this->getView($controller);
$template = dirname(__FILE__) . '/display.html';
$template = APP_PATH . 'views' . DS .'display.html';
$viewFetch = $view->display($template, ['name' => 'ThinkPHP']);
$this->assertEquals($controller->displayTest(), $viewFetch);