完善单元测试

This commit is contained in:
thinkphp
2016-02-28 15:25:33 +08:00
parent 4cc8e7d52b
commit 69055ca068
2 changed files with 42 additions and 24 deletions

View File

@@ -26,6 +26,14 @@ class routeTest extends \PHPUnit_Framework_TestCase
Route::get('hello/:name', 'index/hello');
Route::get(['hello/:name' => 'index/hello']);
$this->assertEquals(['type' => 'module', 'module' => [null, 'index', 'hello']], Route::check('hello/thinkphp'));
$this->assertEquals(['hello/:name' => ['route' => 'index/hello', 'option' => [], 'pattern' => []]], Route::getRules('GET'));
}
public function testRouteMap()
{
Route::map('hello', 'index/hello');
//$this->assertEquals('index/hello',Route::map('hello'));
$this->assertEquals(['type' => 'module', 'module' => ['index', 'hello', null]], Route::check('hello'));
}
public function testParseUrl()