mirror of
https://github.com/dannyvankooten/AltoRouter.git
synced 2025-07-31 13:40:16 +02:00
fix tests by making compileRoute protected instead
This commit is contained in:
@@ -251,7 +251,7 @@ class AltoRouter {
|
||||
/**
|
||||
* Compile the regex for a given route (EXPENSIVE)
|
||||
*/
|
||||
private function compileRoute($route) {
|
||||
protected function compileRoute($route) {
|
||||
if (preg_match_all('`(/|\.|)\[([^:\]]*+)(?::([^:\]]*+))?\](\?|)`', $route, $matches, PREG_SET_ORDER)) {
|
||||
|
||||
$matchTypes = $this->matchTypes;
|
||||
|
@@ -10,6 +10,7 @@ class AltoRouterDebug extends AltoRouter{
|
||||
public function getBasePath(){
|
||||
return $this->basePath;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class SimpleTraversable implements Iterator{
|
||||
@@ -72,7 +73,7 @@ class AltoRouterTest extends PHPUnit\Framework\TestCase
|
||||
$route = '/[:controller]/[:action]';
|
||||
$target = function(){};
|
||||
|
||||
$this->assertInternalType('array', $this->router->getRoutes());
|
||||
$this->assertIsArray($this->router->getRoutes());
|
||||
$this->router->map($method, $route, $target);
|
||||
$this->assertEquals(array(array($method, $route, $target, null)), $this->router->getRoutes());
|
||||
}
|
||||
|
Reference in New Issue
Block a user