示例#1
0
 public function testAddByConstructor()
 {
     $routes = [new Route('#/0#i', function () {
     }), new Route('#/1#i', function () {
     }), new Route('#/2#i', function () {
     })];
     $collection = new RouteCollection($routes);
     $this->assertSame($routes[0], $collection->current());
     $collection->next();
     $this->assertSame($routes[1], $collection->current());
     $collection->next();
     $this->assertSame($routes[2], $collection->current());
 }