废除模块映射功能 改进route助手函数 Route类增加rule方法替代原register方法,原register方法更名为import方法用于导入路由配置

This commit is contained in:
thinkphp
2016-05-11 23:00:59 +08:00
parent ee837df7c9
commit a4fb28a310
4 changed files with 38 additions and 67 deletions

View File

@@ -33,7 +33,6 @@ class routeTest extends \PHPUnit_Framework_TestCase
Route::any('user/:id', 'index/user');
$this->assertEquals(['type' => 'module', 'module' => [null, 'index', 'hello']], Route::check($request, 'hello/thinkphp'));
$this->assertEquals(['hello/:name' => ['route' => 'index/hello', 'option' => [], 'pattern' => []]], Route::getRules('GET'));
Route::register('type/:name', 'index/type', 'PUT|POST');
Route::rule('type/:name', 'index/type', 'PUT|POST');
}