/** * Route should set name */ public function testRouteSetsName() { $route = new Slim_Route('/foo/bar', function () { }); $route->name('foo'); $this->assertEquals('foo', $route->getName()); }
/** * Route should set name and be cached by Router */ public function testRouteSetsNameAndIsCached() { $router = new RouterMock(); $route = new Slim_Route('/foo/bar', function () {}); $route->setRouter($router); $route->name('foo'); $cacheKeys = array_keys($router->cache); $cacheValues = array_values($router->cache); $this->assertEquals($cacheKeys[0], 'foo'); $this->assertSame($cacheValues[0], $route); }