修正单元测试 删除controller类show方法 用 display方法替代

This commit is contained in:
thinkphp
2016-04-18 18:08:08 +08:00
parent 2e6ba63ed9
commit da9c1a8a81
4 changed files with 17 additions and 39 deletions

View File

@@ -124,17 +124,15 @@ class controllerTest extends \PHPUnit_Framework_TestCase
$viewFetch = $view->fetch($template, ['name' => 'ThinkPHP']);
$controllerFetch = $controller->fetch($template, ['name' => 'ThinkPHP']);
$this->assertEquals($controllerFetch, $viewFetch);
$controllerFetch = $controller->display($template, ['name' => 'ThinkPHP']);
$this->assertEquals($controllerFetch, $viewFetch);
}
public function testShow()
public function testDisplay()
{
$controller = new Foo;
$view = $this->getView($controller);
$template = dirname(__FILE__) . '/display.html';
$viewFetch = $view->show($template, ['name' => 'ThinkPHP']);
$controllerFetch = $controller->show($template, ['name' => 'ThinkPHP']);
$viewFetch = $view->display($template, ['name' => 'ThinkPHP']);
$controllerFetch = $controller->display($template, ['name' => 'ThinkPHP']);
$this->assertEquals($controllerFetch, $viewFetch);
}
@@ -148,16 +146,6 @@ class controllerTest extends \PHPUnit_Framework_TestCase
$this->assertAttributeEquals($expect, 'data', $view);
}
public function testEngine()
{
$controller = new Foo;
$view = $this->getView($controller);
$view->engine = null;
$this->assertEquals(null, $view->engine);
$controller->engine('php');
$this->assertEquals('php', $view->engine);
}
public function testValidate()
{
$controller = new Foo;