Пример #1
0
 public function testGetCallable()
 {
     $callable = function () {
         echo 'Foo';
     };
     $route = new \Slim\Route('/foo', $callable);
     $this->assertSame($callable, $route->getCallable());
 }
Пример #2
0
 public function testGetCallableAsStaticMethod()
 {
     $route = new \Slim\Route('/bar', '\\Slim\\Slim::getInstance');
     $callable = $route->getCallable();
     $this->assertEquals('\\Slim\\Slim::getInstance', $callable);
 }
Пример #3
0
 /**
  * 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());
 }
Пример #4
0
 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());
 }