mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-03 22:02:48 +08:00
App类改进run方法传入Request对象 便于构造自己的Request对象
This commit is contained in:
@@ -26,17 +26,17 @@ class urlTest extends \PHPUnit_Framework_TestCase
|
||||
public function testBuildModule()
|
||||
{
|
||||
|
||||
Route::get('hello/:name', 'index/hello');
|
||||
Route::get('hello/:id', 'index/hello');
|
||||
Route::get('blog/:name', 'index/blog');
|
||||
Route::get('blog/:id', 'index/blog');
|
||||
Config::set('pathinfo_depr', '/');
|
||||
$this->assertEquals('/hello/thinkphp', Url::build('index/hello?name=thinkphp'));
|
||||
$this->assertEquals('/hello/thinkphp.html', Url::build('index/hello', 'name=thinkphp', 'html'));
|
||||
$this->assertEquals('/hello/10', Url::build('index/hello?id=10'));
|
||||
$this->assertEquals('/hello/10.html', Url::build('index/hello', 'id=10', 'html'));
|
||||
$this->assertEquals('/blog/thinkphp', Url::build('index/blog?name=thinkphp'));
|
||||
$this->assertEquals('/blog/thinkphp.html', Url::build('index/blog', 'name=thinkphp', 'html'));
|
||||
$this->assertEquals('/blog/10', Url::build('index/blog?id=10'));
|
||||
$this->assertEquals('/blog/10.html', Url::build('index/blog', 'id=10', 'html'));
|
||||
|
||||
Route::get('item-<item><id?>', 'good/item', [], ['item' => '\w+', 'id' => '\d+']);
|
||||
$this->assertEquals('/item-thinkphp', Url::build('good/item?item=thinkphp'));
|
||||
$this->assertEquals('/item-thinkphp2016', Url::build('good/item?item=thinkphp&id=2016'));
|
||||
Route::get('item-<name><id?>', 'blog/item', [], ['name' => '\w+', 'id' => '\d+']);
|
||||
$this->assertEquals('/item-thinkphp', Url::build('blog/item?name=thinkphp'));
|
||||
$this->assertEquals('/item-thinkphp2016', Url::build('blog/item?name=thinkphp&id=2016'));
|
||||
}
|
||||
|
||||
public function testBuildController()
|
||||
|
||||
Reference in New Issue
Block a user