mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
修正模板文件
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="Generator" content="EditPlus®">
|
||||
<meta name="Author" content="">
|
||||
<meta name="Keywords" content="">
|
||||
<meta name="Description" content="">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -121,12 +121,14 @@ class viewTest extends \PHPUnit_Framework_TestCase
|
||||
public function testParseTemplate()
|
||||
{
|
||||
$view_instance = \think\View::instance();
|
||||
$method = new \ReflectionMethod('\think\View', 'ParseTemplate');
|
||||
$view_instance->theme(true);
|
||||
$view_instance->config(['view_path' => __DIR__ . DS]);
|
||||
$method = new \ReflectionMethod('\think\View', 'ParseTemplate');
|
||||
$method->setAccessible(true);
|
||||
if (defined('CONTROLLER_NAME')) {
|
||||
$expect_data = 'view_path' . 'theme_name' . DS . CONTROLLER_NAME . DS . 'template_name.html';
|
||||
$expect_data = __DIR__ . DS . 'default' . DS . CONTROLLER_NAME . DS . 'template.html';
|
||||
} else {
|
||||
$expect_data = 'view_path' . 'theme_name' . DS . 'template_name.html';
|
||||
$expect_data = __DIR__ . DS . 'default' . DS . 'template.html';
|
||||
}
|
||||
$this->assertEquals($expect_data, $method->invoke($view_instance, 'template_name'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user