完善app单元测试

This commit is contained in:
Haotong Lin
2016-03-04 13:02:10 +08:00
parent 48dd15adda
commit c44474e57e
2 changed files with 75 additions and 5 deletions

View File

@@ -212,11 +212,11 @@ class App
// 获取控制器名
$controllerName = strip_tags($result[1] ?: Config::get('default_controller'));
define('CONTROLLER_NAME', Config::get('url_controller_convert') ? strtolower($controllerName) : $controllerName);
defined('CONTROLLER_NAME') or define('CONTROLLER_NAME', Config::get('url_controller_convert') ? strtolower($controllerName) : $controllerName);
// 获取操作名
$actionName = strip_tags($result[2] ?: Config::get('default_action'));
define('ACTION_NAME', Config::get('url_action_convert') ? strtolower($actionName) : $actionName);
defined('ACTION_NAME') or define('ACTION_NAME', Config::get('url_action_convert') ? strtolower($actionName) : $actionName);
// 执行操作
if (!preg_match('/^[A-Za-z](\/|\.|\w)*$/', CONTROLLER_NAME)) {