public function testGetCallable() { $callable = function () { echo 'Foo'; }; $route = new \Slim\Route('/foo', $callable); $this->assertSame($callable, $route->getCallable()); }
public function testGetCallableAsStaticMethod() { $route = new \Slim\Route('/bar', '\\Slim\\Slim::getInstance'); $callable = $route->getCallable(); $this->assertEquals('\\Slim\\Slim::getInstance', $callable); }
/** * Route should store a reference to the callable * regular function (for PHP 5 < 5.3) */ public function testRouteSetsCallableAsString() { $route = new \Slim\Route('/foo/bar', 'testCallable'); $this->assertEquals('testCallable', $route->getCallable()); }
public function testGetCallableWithOddCharsAsClass() { $route = new \Slim\Route('/foo', '\\RouteTest:example_càllâble_wïth_wéird_chars'); $callable = $route->getCallable(); $this->assertEquals('test', $callable()); }