mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
修正单元测试
This commit is contained in:
@@ -260,7 +260,7 @@ class View
|
|||||||
$template = str_replace('.', DS, CONTROLLER_NAME) . $depr . $template;
|
$template = str_replace('.', DS, CONTROLLER_NAME) . $depr . $template;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return realpath($path) . DS . $template . $this->config['view_suffix'];
|
return $path . $template . $this->config['view_suffix'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -124,9 +124,9 @@ class viewTest extends \PHPUnit_Framework_TestCase
|
|||||||
$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 = DS . 'theme_name' . DS . CONTROLLER_NAME . DS . 'template_name.html';
|
$expect_data = 'view_path' . 'theme_name' . DS . CONTROLLER_NAME . DS . 'template_name.html';
|
||||||
} else {
|
} else {
|
||||||
$expect_data = DS . 'theme_name' . DS . 'template_name.html';
|
$expect_data = 'view_path' . 'theme_name' . DS . 'template_name.html';
|
||||||
}
|
}
|
||||||
$this->assertEquals($expect_data, $method->invoke($view_instance, 'template_name'));
|
$this->assertEquals($expect_data, $method->invoke($view_instance, 'template_name'));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user