/** * 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('foo', $route->getName()); $this->assertSame($router, $route->getRouter()); $this->assertEquals($cacheKeys[0], 'foo'); $this->assertSame($cacheValues[0], $route); }