| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -6,39 +6,37 @@
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 * @license     MIT, http://flightphp.com/license
 | 
					 | 
					 | 
					 | 
					 * @license     MIT, http://flightphp.com/license
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 */
 | 
					 | 
					 | 
					 | 
					 */
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					use flight\core\Dispatcher;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					use flight\net\Request;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					use flight\net\Router;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					require_once 'vendor/autoload.php';
 | 
					 | 
					 | 
					 | 
					require_once 'vendor/autoload.php';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					require_once __DIR__.'/../flight/autoload.php';
 | 
					 | 
					 | 
					 | 
					require_once __DIR__ . '/../flight/autoload.php';
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					class RouterTest extends PHPUnit_Framework_TestCase
 | 
					 | 
					 | 
					 | 
					class RouterTest extends PHPUnit\Framework\TestCase
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{
 | 
					 | 
					 | 
					 | 
					{
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    /**
 | 
					 | 
					 | 
					 | 
					    private Router $router;
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @var \flight\net\Router
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     */
 | 
					 | 
					 | 
					 | 
					    private Request $request;
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private $router;
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					    private Dispatcher $dispatcher;
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    /**
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @var \flight\net\Request
 | 
					 | 
					 | 
					 | 
					    protected function setUp(): void
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     */
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private $request;
 | 
					 | 
					 | 
					 | 
					        $this->router = new Router();
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					        $this->request = new Request();
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    /**
 | 
					 | 
					 | 
					 | 
					        $this->dispatcher = new Dispatcher();
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @var \flight\core\Dispatcher
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     */
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private $dispatcher;
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function setUp(){
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router = new \flight\net\Router();
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request = new \flight\net\Request();
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->dispatcher = new \flight\core\Dispatcher();
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Simple output
 | 
					 | 
					 | 
					 | 
					    // Simple output
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function ok(){
 | 
					 | 
					 | 
					 | 
					    public function ok()
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        echo 'OK';
 | 
					 | 
					 | 
					 | 
					        echo 'OK';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Checks if a route was matched with a given output
 | 
					 | 
					 | 
					 | 
					    // Checks if a route was matched with a given output
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function check($str = '') {
 | 
					 | 
					 | 
					 | 
					    public function check($str = '')
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        /*
 | 
					 | 
					 | 
					 | 
					        /*
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $route = $this->router->route($this->request);
 | 
					 | 
					 | 
					 | 
					        $route = $this->router->route($this->request);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -53,7 +51,8 @@ class RouterTest extends PHPUnit_Framework_TestCase
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->expectOutputString($str);
 | 
					 | 
					 | 
					 | 
					        $this->expectOutputString($str);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function routeRequest() {
 | 
					 | 
					 | 
					 | 
					    public function routeRequest()
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $dispatched = false;
 | 
					 | 
					 | 
					 | 
					        $dispatched = false;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        while ($route = $this->router->route($this->request)) {
 | 
					 | 
					 | 
					 | 
					        while ($route = $this->router->route($this->request)) {
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -70,7 +69,9 @@ class RouterTest extends PHPUnit_Framework_TestCase
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            $dispatched = true;
 | 
					 | 
					 | 
					 | 
					            $dispatched = true;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (!$continue) break;
 | 
					 | 
					 | 
					 | 
					            if (!$continue) {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                break;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            $this->router->next();
 | 
					 | 
					 | 
					 | 
					            $this->router->next();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -83,24 +84,27 @@ class RouterTest extends PHPUnit_Framework_TestCase
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Default route
 | 
					 | 
					 | 
					 | 
					    // Default route
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function testDefaultRoute(){
 | 
					 | 
					 | 
					 | 
					    public function testDefaultRoute()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('/', array($this, 'ok'));
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        $this->router->map('/', [$this, 'ok']);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->url = '/';
 | 
					 | 
					 | 
					 | 
					        $this->request->url = '/';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->check('OK');
 | 
					 | 
					 | 
					 | 
					        $this->check('OK');
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Simple path
 | 
					 | 
					 | 
					 | 
					    // Simple path
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function testPathRoute(){
 | 
					 | 
					 | 
					 | 
					    public function testPathRoute()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('/path', array($this, 'ok'));
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        $this->router->map('/path', [$this, 'ok']);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->url = '/path';
 | 
					 | 
					 | 
					 | 
					        $this->request->url = '/path';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->check('OK');
 | 
					 | 
					 | 
					 | 
					        $this->check('OK');
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // POST route
 | 
					 | 
					 | 
					 | 
					    // POST route
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function testPostRoute(){
 | 
					 | 
					 | 
					 | 
					    public function testPostRoute()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('POST /', array($this, 'ok'));
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        $this->router->map('POST /', [$this, 'ok']);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->url = '/';
 | 
					 | 
					 | 
					 | 
					        $this->request->url = '/';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->method = 'POST';
 | 
					 | 
					 | 
					 | 
					        $this->request->method = 'POST';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -108,8 +112,9 @@ class RouterTest extends PHPUnit_Framework_TestCase
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Either GET or POST route
 | 
					 | 
					 | 
					 | 
					    // Either GET or POST route
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function testGetPostRoute(){
 | 
					 | 
					 | 
					 | 
					    public function testGetPostRoute()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('GET|POST /', array($this, 'ok'));
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        $this->router->map('GET|POST /', [$this, 'ok']);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->url = '/';
 | 
					 | 
					 | 
					 | 
					        $this->request->url = '/';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->method = 'GET';
 | 
					 | 
					 | 
					 | 
					        $this->request->method = 'GET';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -117,16 +122,18 @@ class RouterTest extends PHPUnit_Framework_TestCase
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Test regular expression matching
 | 
					 | 
					 | 
					 | 
					    // Test regular expression matching
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function testRegEx(){
 | 
					 | 
					 | 
					 | 
					    public function testRegEx()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('/num/[0-9]+', array($this, 'ok'));
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        $this->router->map('/num/[0-9]+', [$this, 'ok']);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->url = '/num/1234';
 | 
					 | 
					 | 
					 | 
					        $this->request->url = '/num/1234';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->check('OK');
 | 
					 | 
					 | 
					 | 
					        $this->check('OK');
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Passing URL parameters
 | 
					 | 
					 | 
					 | 
					    // Passing URL parameters
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function testUrlParameters(){
 | 
					 | 
					 | 
					 | 
					    public function testUrlParameters()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('/user/@id', function($id){
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        $this->router->map('/user/@id', function ($id) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            echo $id;
 | 
					 | 
					 | 
					 | 
					            echo $id;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        });
 | 
					 | 
					 | 
					 | 
					        });
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->url = '/user/123';
 | 
					 | 
					 | 
					 | 
					        $this->request->url = '/user/123';
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -135,8 +142,9 @@ class RouterTest extends PHPUnit_Framework_TestCase
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Passing URL parameters matched with regular expression
 | 
					 | 
					 | 
					 | 
					    // Passing URL parameters matched with regular expression
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function testRegExParameters(){
 | 
					 | 
					 | 
					 | 
					    public function testRegExParameters()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('/test/@name:[a-z]+', function($name){
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        $this->router->map('/test/@name:[a-z]+', function ($name) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            echo $name;
 | 
					 | 
					 | 
					 | 
					            echo $name;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        });
 | 
					 | 
					 | 
					 | 
					        });
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->url = '/test/abc';
 | 
					 | 
					 | 
					 | 
					        $this->request->url = '/test/abc';
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -145,8 +153,9 @@ class RouterTest extends PHPUnit_Framework_TestCase
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Optional parameters
 | 
					 | 
					 | 
					 | 
					    // Optional parameters
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function testOptionalParameters(){
 | 
					 | 
					 | 
					 | 
					    public function testOptionalParameters()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('/blog(/@year(/@month(/@day)))', function($year, $month, $day){
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        $this->router->map('/blog(/@year(/@month(/@day)))', function ($year, $month, $day) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            echo "$year,$month,$day";
 | 
					 | 
					 | 
					 | 
					            echo "$year,$month,$day";
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        });
 | 
					 | 
					 | 
					 | 
					        });
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->url = '/blog/2000';
 | 
					 | 
					 | 
					 | 
					        $this->request->url = '/blog/2000';
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -155,8 +164,9 @@ class RouterTest extends PHPUnit_Framework_TestCase
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Regex in optional parameters
 | 
					 | 
					 | 
					 | 
					    // Regex in optional parameters
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function testRegexOptionalParameters(){
 | 
					 | 
					 | 
					 | 
					    public function testRegexOptionalParameters()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('/@controller/@method(/@id:[0-9]+)', function($controller, $method, $id){
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        $this->router->map('/@controller/@method(/@id:[0-9]+)', function ($controller, $method, $id) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            echo "$controller,$method,$id";
 | 
					 | 
					 | 
					 | 
					            echo "$controller,$method,$id";
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        });
 | 
					 | 
					 | 
					 | 
					        });
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->url = '/user/delete/123';
 | 
					 | 
					 | 
					 | 
					        $this->request->url = '/user/delete/123';
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -165,8 +175,9 @@ class RouterTest extends PHPUnit_Framework_TestCase
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Regex in optional parameters
 | 
					 | 
					 | 
					 | 
					    // Regex in optional parameters
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function testRegexEmptyOptionalParameters(){
 | 
					 | 
					 | 
					 | 
					    public function testRegexEmptyOptionalParameters()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('/@controller/@method(/@id:[0-9]+)', function($controller, $method, $id){
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        $this->router->map('/@controller/@method(/@id:[0-9]+)', function ($controller, $method, $id) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            echo "$controller,$method,$id";
 | 
					 | 
					 | 
					 | 
					            echo "$controller,$method,$id";
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        });
 | 
					 | 
					 | 
					 | 
					        });
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->url = '/user/delete/';
 | 
					 | 
					 | 
					 | 
					        $this->request->url = '/user/delete/';
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -175,39 +186,42 @@ class RouterTest extends PHPUnit_Framework_TestCase
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Wildcard matching
 | 
					 | 
					 | 
					 | 
					    // Wildcard matching
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function testWildcard(){
 | 
					 | 
					 | 
					 | 
					    public function testWildcard()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('/account/*', array($this, 'ok'));
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        $this->router->map('/account/*', [$this, 'ok']);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->url = '/account/123/abc/xyz';
 | 
					 | 
					 | 
					 | 
					        $this->request->url = '/account/123/abc/xyz';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->check('OK');
 | 
					 | 
					 | 
					 | 
					        $this->check('OK');
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Check if route object was passed
 | 
					 | 
					 | 
					 | 
					    // Check if route object was passed
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function testRouteObjectPassing(){
 | 
					 | 
					 | 
					 | 
					    public function testRouteObjectPassing()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('/yes_route', function($route){
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            $this->assertTrue(is_object($route));
 | 
					 | 
					 | 
					 | 
					        $this->router->map('/yes_route', function ($route) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            $this->assertTrue(is_array($route->methods));
 | 
					 | 
					 | 
					 | 
					            $this->assertIsObject($route);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            $this->assertTrue(is_array($route->params));
 | 
					 | 
					 | 
					 | 
					            $this->assertIsArray($route->methods);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            $this->assertEquals(sizeof($route->params), 0);
 | 
					 | 
					 | 
					 | 
					            $this->assertIsArray($route->params);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            $this->assertEquals($route->regex, null);
 | 
					 | 
					 | 
					 | 
					            $this->assertCount(0, $route->params);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            $this->assertEquals($route->splat, '');
 | 
					 | 
					 | 
					 | 
					            $this->assertNull($route->regex);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            $this->assertEquals('', $route->splat);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            $this->assertTrue($route->pass);
 | 
					 | 
					 | 
					 | 
					            $this->assertTrue($route->pass);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        }, true);
 | 
					 | 
					 | 
					 | 
					        }, true);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->url = '/yes_route';
 | 
					 | 
					 | 
					 | 
					        $this->request->url = '/yes_route';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->check();
 | 
					 | 
					 | 
					 | 
					        $this->check();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('/no_route', function($route = null){
 | 
					 | 
					 | 
					 | 
					        $this->router->map('/no_route', function ($route = null) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            $this->assertTrue(is_null($route));
 | 
					 | 
					 | 
					 | 
					            $this->assertNull($route);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        }, false);
 | 
					 | 
					 | 
					 | 
					        }, false);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->url = '/no_route';
 | 
					 | 
					 | 
					 | 
					        $this->request->url = '/no_route';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->check();
 | 
					 | 
					 | 
					 | 
					        $this->check();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function testRouteWithParameters() {
 | 
					 | 
					 | 
					 | 
					    public function testRouteWithParameters()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('/@one/@two', function($one, $two, $route){
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            $this->assertEquals(sizeof($route->params), 2);
 | 
					 | 
					 | 
					 | 
					        $this->router->map('/@one/@two', function ($one, $two, $route) {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            $this->assertCount(2, $route->params);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            $this->assertEquals($route->params['one'], $one);
 | 
					 | 
					 | 
					 | 
					            $this->assertEquals($route->params['one'], $one);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            $this->assertEquals($route->params['two'], $two);
 | 
					 | 
					 | 
					 | 
					            $this->assertEquals($route->params['two'], $two);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        }, true);
 | 
					 | 
					 | 
					 | 
					        }, true);
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -217,8 +231,9 @@ class RouterTest extends PHPUnit_Framework_TestCase
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Test splat
 | 
					 | 
					 | 
					 | 
					    // Test splat
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function testSplatWildcard(){
 | 
					 | 
					 | 
					 | 
					    public function testSplatWildcard()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('/account/*', function($route){
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        $this->router->map('/account/*', function ($route) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            echo $route->splat;
 | 
					 | 
					 | 
					 | 
					            echo $route->splat;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        }, true);
 | 
					 | 
					 | 
					 | 
					        }, true);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->url = '/account/456/def/xyz';
 | 
					 | 
					 | 
					 | 
					        $this->request->url = '/account/456/def/xyz';
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -227,8 +242,9 @@ class RouterTest extends PHPUnit_Framework_TestCase
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Test splat without trailing slash
 | 
					 | 
					 | 
					 | 
					    // Test splat without trailing slash
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function testSplatWildcardTrailingSlash(){
 | 
					 | 
					 | 
					 | 
					    public function testSplatWildcardTrailingSlash()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('/account/*', function($route){
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        $this->router->map('/account/*', function ($route) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            echo $route->splat;
 | 
					 | 
					 | 
					 | 
					            echo $route->splat;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        }, true);
 | 
					 | 
					 | 
					 | 
					        }, true);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->url = '/account';
 | 
					 | 
					 | 
					 | 
					        $this->request->url = '/account';
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -237,42 +253,44 @@ class RouterTest extends PHPUnit_Framework_TestCase
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Test splat with named parameters
 | 
					 | 
					 | 
					 | 
					    // Test splat with named parameters
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function testSplatNamedPlusWildcard(){
 | 
					 | 
					 | 
					 | 
					    public function testSplatNamedPlusWildcard()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('/account/@name/*', function($name, $route){
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                echo $route->splat;
 | 
					 | 
					 | 
					 | 
					        $this->router->map('/account/@name/*', function ($name, $route) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                $this->assertEquals('abc', $name);
 | 
					 | 
					 | 
					 | 
					            echo $route->splat;
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            }, true);
 | 
					 | 
					 | 
					 | 
					            $this->assertEquals('abc', $name);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        }, true);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->url = '/account/abc/456/def/xyz';
 | 
					 | 
					 | 
					 | 
					        $this->request->url = '/account/abc/456/def/xyz';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->check('456/def/xyz');
 | 
					 | 
					 | 
					 | 
					        $this->check('456/def/xyz');
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Test not found
 | 
					 | 
					 | 
					 | 
					    // Test not found
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function testNotFound() {
 | 
					 | 
					 | 
					 | 
					    public function testNotFound()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('/does_exist', array($this, 'ok'));
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        $this->router->map('/does_exist', [$this, 'ok']);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->url = '/does_not_exist';
 | 
					 | 
					 | 
					 | 
					        $this->request->url = '/does_not_exist';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->check('404');
 | 
					 | 
					 | 
					 | 
					        $this->check('404');
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Test case sensitivity
 | 
					 | 
					 | 
					 | 
					    // Test case sensitivity
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function testCaseSensitivity() {
 | 
					 | 
					 | 
					 | 
					    public function testCaseSensitivity()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('/hello', array($this, 'ok'));
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        $this->router->map('/hello', [$this, 'ok']);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->url = '/HELLO';
 | 
					 | 
					 | 
					 | 
					        $this->request->url = '/HELLO';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->case_sensitive = true;
 | 
					 | 
					 | 
					 | 
					        $this->router->case_sensitive = true;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->check('404');
 | 
					 | 
					 | 
					 | 
					        $this->check('404');
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Passing URL parameters matched with regular expression for a URL containing Cyrillic letters:
 | 
					 | 
					 | 
					 | 
					    // Passing URL parameters matched with regular expression for a URL containing Cyrillic letters:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    function testRegExParametersCyrillic(){
 | 
					 | 
					 | 
					 | 
					    public function testRegExParametersCyrillic()
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->router->map('/категория/@name:[абвгдеёжзийклмнопрстуфхцчшщъыьэюя]+', function($name){
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        $this->router->map('/категория/@name:[абвгдеёжзийклмнопрстуфхцчшщъыьэюя]+', function ($name) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            echo $name;
 | 
					 | 
					 | 
					 | 
					            echo $name;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        });
 | 
					 | 
					 | 
					 | 
					        });
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->request->url = urlencode('/категория/цветя');
 | 
					 | 
					 | 
					 | 
					        $this->request->url = urlencode('/категория/цветя');
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->check('цветя');
 | 
					 | 
					 | 
					 | 
					        $this->check('цветя');
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
					 | 
					 | 
					
 
 |