|  |  | @ -198,6 +198,67 @@ class RouterTest extends TestCase | 
			
		
	
		
		
			
				
					
					|  |  |  |         $this->check('123'); |  |  |  |         $this->check('123'); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public function testUrlParametersWithEncodedSlash() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $this->router->map('/redirect/@id', function ($id) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             echo $id; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         }); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $this->request->url = '/redirect/before%2Fafter'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $this->check('before/after'); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public function testUrlParametersWithRealSlash() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $this->router->map('/redirect/@id', function ($id) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             echo $id; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         }); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $this->request->url = '/redirect/before/after'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $this->check('404'); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public function testUrlParametersWithJapanese() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $this->router->map('/わたしはひとです', function () { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             echo 'はい'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         }); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $this->request->url = '/わたしはひとです'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $this->check('はい'); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public function testUrlParametersWithJapaneseAndParam() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $this->router->map('/わたしはひとです/@name', function ($name) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             echo $name; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         }); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $this->request->url = '/'.urlencode('わたしはひとです').'/'.urlencode('ええ'); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $this->check('ええ'); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     // Passing URL parameters matched with regular expression for a URL containing Cyrillic letters: | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public function testRegExParametersCyrillic() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $this->router->map('/категория/@name:[абвгдеёжзийклмнопрстуфхцчшщъыьэюя]+', function ($name) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             echo $name; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         }); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $this->request->url = '/'.urlencode('категория').'/'.urlencode('цветя'); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $this->check('цветя'); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public function testRegExOnlyCyrillicUrl() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $this->router->map('/категория/цветя', function () { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             echo 'цветя'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         }); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $this->request->url = '/категория/цветя'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         $this->check('цветя'); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     // Passing URL parameters matched with regular expression |  |  |  |     // Passing URL parameters matched with regular expression | 
			
		
	
		
		
			
				
					
					|  |  |  |     public function testRegExParameters() |  |  |  |     public function testRegExParameters() | 
			
		
	
		
		
			
				
					
					|  |  |  |     { |  |  |  |     { | 
			
		
	
	
		
		
			
				
					|  |  | @ -384,17 +445,6 @@ class RouterTest extends TestCase | 
			
		
	
		
		
			
				
					
					|  |  |  |         $this->check('404'); |  |  |  |         $this->check('404'); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     // Passing URL parameters matched with regular expression for a URL containing Cyrillic letters: |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     public function testRegExParametersCyrillic() |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         $this->router->map('/категория/@name:[абвгдеёжзийклмнопрстуфхцчшщъыьэюя]+', function ($name) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             echo $name; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         }); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         $this->request->url = urlencode('/категория/цветя'); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         $this->check('цветя'); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     public function testGetAndClearRoutes() |  |  |  |     public function testGetAndClearRoutes() | 
			
		
	
		
		
			
				
					
					|  |  |  |     { |  |  |  |     { | 
			
		
	
		
		
			
				
					
					|  |  |  |         $this->router->map('/path1', [$this, 'ok']); |  |  |  |         $this->router->map('/path1', [$this, 'ok']); | 
			
		
	
	
		
		
			
				
					|  |  | 
 |