You are here

protected function GroupCheckTest::setUp in Organic groups 8

Overrides UnitTestCase::setUp

File

tests/src/Unit/GroupCheckTest.php, line 122

Class

GroupCheckTest
Tests the group check access.

Namespace

Drupal\Tests\og\Unit

Code

protected function setUp() : void {
  $this->entityTypeManager = $this
    ->prophesize(EntityTypeManagerInterface::class);
  $this->entityType = $this
    ->prophesize(EntityTypeInterface::class);
  $this->entityStorage = $this
    ->prophesize(EntityStorageInterface::class);
  $this->ogAccess = $this
    ->prophesize(OgAccessInterface::class);
  $this->route = $this
    ->prophesize(Route::class);
  $this->routeMatch = $this
    ->prophesize(RouteMatchInterface::class);
  $this->entityTypeId = $this
    ->randomMachineName();
  $this->bundle = $this
    ->randomMachineName();
  $this->entityId = rand(10, 50);
  $this->groupTypeManager = $this
    ->prophesize(GroupTypeManagerInterface::class);
  $this->user = $this
    ->prophesize(AccountInterface::class);
  $this->group = $this
    ->prophesize(EntityInterface::class);
  $this->accessResult = $this
    ->prophesize(AccessResultInterface::class);
  $container = new ContainerBuilder();
  $container
    ->set('og.group_type_manager', $this->groupTypeManager
    ->reveal());
  \Drupal::setContainer($container);
}