1
0
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:
Danny van Kooten
2019-02-07 09:16:13 +01:00
parent df96d7270c
commit 9bdfc55eb3
2 changed files with 3 additions and 2 deletions

View File

@@ -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;

View File

@@ -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());
}