mirror of
https://github.com/dannyvankooten/AltoRouter.git
synced 2025-08-05 07:57:38 +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)
|
* 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)) {
|
if (preg_match_all('`(/|\.|)\[([^:\]]*+)(?::([^:\]]*+))?\](\?|)`', $route, $matches, PREG_SET_ORDER)) {
|
||||||
|
|
||||||
$matchTypes = $this->matchTypes;
|
$matchTypes = $this->matchTypes;
|
||||||
|
@@ -10,6 +10,7 @@ class AltoRouterDebug extends AltoRouter{
|
|||||||
public function getBasePath(){
|
public function getBasePath(){
|
||||||
return $this->basePath;
|
return $this->basePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class SimpleTraversable implements Iterator{
|
class SimpleTraversable implements Iterator{
|
||||||
@@ -72,7 +73,7 @@ class AltoRouterTest extends PHPUnit\Framework\TestCase
|
|||||||
$route = '/[:controller]/[:action]';
|
$route = '/[:controller]/[:action]';
|
||||||
$target = function(){};
|
$target = function(){};
|
||||||
|
|
||||||
$this->assertInternalType('array', $this->router->getRoutes());
|
$this->assertIsArray($this->router->getRoutes());
|
||||||
$this->router->map($method, $route, $target);
|
$this->router->map($method, $route, $target);
|
||||||
$this->assertEquals(array(array($method, $route, $target, null)), $this->router->getRoutes());
|
$this->assertEquals(array(array($method, $route, $target, null)), $this->router->getRoutes());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user