mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 15:02:47 +08:00
修正单元测试
This commit is contained in:
@@ -121,14 +121,13 @@ class viewTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function testParseTemplate()
|
public function testParseTemplate()
|
||||||
{
|
{
|
||||||
$view_instance = \think\View::instance();
|
$view_instance = \think\View::instance();
|
||||||
$view_instance->theme(true);
|
|
||||||
$view_instance->config(['view_path' => __DIR__ . DS . 'view' . DS]);
|
$view_instance->config(['view_path' => __DIR__ . DS . 'view' . DS]);
|
||||||
$method = new \ReflectionMethod('\think\View', 'ParseTemplate');
|
$method = new \ReflectionMethod('\think\View', 'ParseTemplate');
|
||||||
$method->setAccessible(true);
|
$method->setAccessible(true);
|
||||||
if (defined('CONTROLLER_NAME')) {
|
if (defined('CONTROLLER_NAME')) {
|
||||||
$expect_data = __DIR__ . DS . 'view' . DS . 'default' . DS . CONTROLLER_NAME . DS . 'template.html';
|
$expect_data = __DIR__ . DS . 'view' . DS . 'theme_name' . DS . CONTROLLER_NAME . DS . 'template.html';
|
||||||
} else {
|
} else {
|
||||||
$expect_data = __DIR__ . DS . 'view' . DS . 'default' . DS . 'template.html';
|
$expect_data = __DIR__ . DS . 'view' . DS . 'theme_name' . DS . 'template.html';
|
||||||
}
|
}
|
||||||
$this->assertEquals($expect_data, $method->invoke($view_instance, 'template'));
|
$this->assertEquals($expect_data, $method->invoke($view_instance, 'template'));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user