public function testRemoveWithAlreadyBuilderRouteMap() { $route1 = new Route('/route1'); $route2 = new Route('/route2'); $this->collection->add('route1', $route1); $this->collection->add('route2', $route2); // force the route map building $this->assertSame($route1, $this->accessor->getByPath('/route1', [])); $this->accessor->remove('route1'); $this->assertEquals(['route2'], array_keys($this->collection->all())); $this->assertNull($this->accessor->getByPath('/route1', [])); }
/** * Returns a string which can be used as a name of auto generated route. * * @param string $routeNameSample * * @return string */ public function generateRouteName($routeNameSample) { return sprintf('%s_auto_%d', $routeNameSample, $this->collection->count() + 1); }