You are here

protected function OgRouteGroupResolverTestBase::mightCheckIfRouteObjectIsGroup in Organic groups 8

Adds an expectation that checks if the route object is a group.

If the plugin found a content entity on the route then it should check whether the entity is a group or not. If no content entity was found, it should not perform this check.

Parameters

string|null $route_object_id: The ID of the entity that is present on the current route, or NULL if we are not on a content entity path. The ID may be any of the ones created in the test setup, e.g. 'group', 'group_content', 'non_group'.

1 call to OgRouteGroupResolverTestBase::mightCheckIfRouteObjectIsGroup()
OgRouteGroupResolverTestBase::testResolve in tests/src/Unit/Plugin/OgGroupResolver/OgRouteGroupResolverTestBase.php
@todo Update documentation.

File

tests/src/Unit/Plugin/OgGroupResolver/OgRouteGroupResolverTestBase.php, line 234

Class

OgRouteGroupResolverTestBase
Base class for testing OgGroupResolver plugins that depend on the route.

Namespace

Drupal\Tests\og\Unit\Plugin\OgGroupResolver

Code

protected function mightCheckIfRouteObjectIsGroup($route_object_id) {
  $properties = $this
    ->getTestEntityProperties();
  $entity_type_id = $properties[$route_object_id]['type'];
  $bundle = $properties[$route_object_id]['bundle'];
  $this->groupTypeManager
    ->isGroup($entity_type_id, $bundle)
    ->willReturn(!empty($properties[$route_object_id]['group']));
}