use PHPUnit\Framework\TestCase;
use Symfony\Component\Routing\Matcher\Dumper\StaticPrefixCollection;
use Symfony\Component\Routing\Route;
class StaticPrefixCollectionTest extends TestCase
{ /**
* @dataProvider routeProvider
*/
public function testGrouping(array
$routes,
$expected) { $collection =
new StaticPrefixCollection('/'
);
foreach ($routes as $route) { [$path,
$name] =
$route;
$staticPrefix =
(new Route($path))->
compile()->
getStaticPrefix();
$collection->
addRoute($staticPrefix,
[$name]);
} $dumped =
$this->
dumpCollection($collection);
$this->
assertEquals($expected,
$dumped);
}