You are here

protected function OgAdminRoutesControllerTest::getRenderElementResult in Organic groups 8

Return the render array from calling the "overview" method.

Parameters

bool $allow_access: Indicate if access to the routes should be given.

Return value

array The render array.

2 calls to OgAdminRoutesControllerTest::getRenderElementResult()
OgAdminRoutesControllerTest::testRoutesWithAccess in tests/src/Unit/OgAdminRoutesControllerTest.php
Tests overview with accessible routes.
OgAdminRoutesControllerTest::testRoutesWithNoAccess in tests/src/Unit/OgAdminRoutesControllerTest.php
Tests overview with non-accessible routes.

File

tests/src/Unit/OgAdminRoutesControllerTest.php, line 214

Class

OgAdminRoutesControllerTest
Tests the OG admin routes overview route.

Namespace

Drupal\Tests\og\Unit

Code

protected function getRenderElementResult($allow_access) {
  $parameters = [
    $this->entityTypeId => $this->entityId,
  ];
  foreach (array_keys($this->routesInfo) as $name) {
    $route_name = "entity.{$this->entityTypeId}.og_admin_routes.{$name}";
    $this->accessManager
      ->checkNamedRoute($route_name, $parameters)
      ->willReturn($allow_access);
  }
  $og_admin_routes_controller = new OgAdminRoutesController($this->eventDispatcher
    ->reveal(), $this->accessManager
    ->reveal());
  return $og_admin_routes_controller
    ->overview($this->routeMatch
    ->reveal());
}