[Routing] fixed previous merge
This commit is contained in:
parent
db9a8c1e4e
commit
c67cf8b56b
@ -95,7 +95,12 @@ class RouteCollection implements \IteratorAggregate, \Countable
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
return count($this->routes->all());
|
||||
$count = 0;
|
||||
foreach ($this->routes as $route) {
|
||||
$count += $route instanceof RouteCollection ? count($route) : 1;
|
||||
}
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -83,7 +83,7 @@ class RouteCollectionTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$collection1 = new RouteCollection();
|
||||
$collection->addCollection($collection1);
|
||||
$collection1->add('foo', new Route('/foo1'));
|
||||
$collection1->add('foo1', new Route('/foo1'));
|
||||
|
||||
$this->assertCount(2, $collection);
|
||||
}
|
||||
|
Reference in New Issue
Block a user