public function testResolve()
 {
     $route = new Route('/{activity}/route', [], [], ['group' => ActivityAssociationRouteOptionsResolver::ROUTE_GROUP]);
     $this->routeCollection->add('first_route', new Route('/first_route'));
     $this->routeCollection->add('override_before', new Route('/events/route'));
     $this->routeCollection->add('some_route', new Route('/some_route'));
     $this->routeCollection->add('tested_route', $route);
     $this->routeCollection->add('override_after', new Route('/emails/route'));
     $this->routeCollection->add('last_route', new Route('/last_route'));
     $config1 = new Config(new EntityConfigId('grouping', 'Test\\Email'));
     $config1->set('groups', ['activity']);
     $config2 = new Config(new EntityConfigId('grouping', 'Test\\Call'));
     $config2->set('groups', ['test', 'activity']);
     $config3 = new Config(new EntityConfigId('grouping', 'Test\\Task'));
     $config3->set('groups', ['activity']);
     $config4 = new Config(new EntityConfigId('grouping', 'Test\\Message'));
     $config5 = new Config(new EntityConfigId('grouping', 'Test\\Event'));
     $config5->set('groups', ['activity']);
     $this->groupingConfigProvider->expects($this->once())->method('getConfigs')->with(null, false)->willReturn([$config1, $config2, $config3, $config4, $config5]);
     $this->entityAliasResolver->expects($this->exactly(4))->method('getPluralAlias')->willReturnMap([['Test\\Email', 'emails'], ['Test\\Call', 'calls'], ['Test\\Task', 'tasks'], ['Test\\Event', 'events']]);
     $this->routeOptionsResolver->resolve($route, $this->routeCollectionAccessor);
     $this->assertEquals(['activity' => '\\w+'], $route->getRequirements());
     $this->routeCollection->sortByPriority();
     $this->assertEquals(['first_route', 'some_route', 'override_after', 'tested_route_auto_7', 'tested_route_auto_8', 'override_before', 'tested_route', 'last_route'], array_keys($this->routeCollection->all()));
     $this->assertEquals('\\w+', $this->routeCollection->get('tested_route')->getRequirement('activity'));
     $this->assertEquals('calls', $this->routeCollection->get('tested_route_auto_7')->getDefault('activity'));
     $this->assertEquals('tasks', $this->routeCollection->get('tested_route_auto_8')->getDefault('activity'));
 }
 public function testResolve()
 {
     $route = new Route('/{activity}/route', [], [], ['group' => 'activity_association']);
     $this->routeCollection->add('first_route', new Route('/first_route'));
     $this->routeCollection->add('override1', new Route('/notes/route'));
     $this->routeCollection->add('some_route', new Route('/some_route'));
     $this->routeCollection->add('tested_route', $route);
     $this->routeCollection->add('override2', new Route('/emails/route'));
     $this->routeCollection->add('last_route', new Route('/last_route'));
     $config1 = new Config(new EntityConfigId('grouping', 'Test\\Email'));
     $config1->set('groups', ['activity']);
     $config2 = new Config(new EntityConfigId('grouping', 'Test\\Call'));
     $config2->set('groups', ['test', 'activity']);
     $config3 = new Config(new EntityConfigId('grouping', 'Test\\Message'));
     $config4 = new Config(new EntityConfigId('grouping', 'Test\\Note'));
     $config4->set('groups', ['activity']);
     $this->groupingConfigProvider->expects($this->once())->method('getConfigs')->with(null, false)->willReturn([$config1, $config2, $config3, $config4]);
     $this->entityAliasResolver->expects($this->exactly(3))->method('getPluralAlias')->willReturnMap([['Test\\Email', 'emails'], ['Test\\Call', 'calls'], ['Test\\Note', 'notes']]);
     $this->routeOptionsResolver->resolve($route, $this->routeCollectionAccessor);
     $this->assertEquals(['activity' => 'emails|calls|notes'], $route->getRequirements());
     $this->routeCollection->sortByPriority();
     $this->assertEquals(['first_route', 'some_route', 'override2', 'tested_route_auto_7', 'override1', 'tested_route', 'last_route'], array_keys($this->routeCollection->all()));
     $this->assertEquals('emails|calls|notes', $this->routeCollection->get('tested_route')->getRequirement('activity'));
     $this->assertEquals('calls', $this->routeCollection->get('tested_route_auto_7')->getDefault('activity'));
 }