public function RouteGroupResolverTest::resolveProvider in Organic groups 8
Data provider for testResolve().
See also
::testResolve()
File
- tests/
src/ Unit/ Plugin/ OgGroupResolver/ RouteGroupResolverTest.php, line 71
Class
- RouteGroupResolverTest
- Tests the RouteGroupResolver plugin.
Namespace
Drupal\Tests\og\Unit\Plugin\OgGroupResolverCode
public function resolveProvider() {
return [
// Test that no groups are returned on a path that is not associated with
// any entities.
[
// A path that is not associated with any entities.
'/user/logout',
// There is no entity on this route.
NULL,
// So the plugin should not find anything.
[],
],
// Test that if we are on the canonical entity page of a group, the
// correct group is returned.
[
// We're on the canonical group entity page.
'/node/{node}',
// The test group is found on the route.
'group',
// The plugin should be able to figure out this is a group.
[
'group',
],
],
// Test that if we are on the delete form of a group, the correct group is
// returned.
[
'/node/{node}/delete',
'group',
[
'group',
],
],
// Test that if we are on the canonical entity page of a group content
// entity, no group should be returned.
[
'/entity_test/{entity_test}',
'group_content',
[],
],
// Test that if we are on the delete form of a group content entity, no
// group should be returned.
[
'/entity_test/delete/entity_test/{entity_test}',
'group_content',
[],
],
// Test that if we are on the canonical entity page of an entity that is
// neither a group nor group content, no group should be returned.
[
'/taxonomy/term/{taxonomy_term}',
'non_group',
[],
],
// Test that if we are on the delete form of an entity that is neither a
// group nor group content, no group should be returned.
[
'/taxonomy/term/{taxonomy_term}/delete',
'non_group',
[],
],
];
}