You are here

protected function WorkspaceRequestSubscriberTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/workspaces/tests/src/Unit/WorkspaceRequestSubscriberTest.php \Drupal\Tests\workspaces\Unit\WorkspaceRequestSubscriberTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/workspaces/tests/src/Unit/WorkspaceRequestSubscriberTest.php, line 40

Class

WorkspaceRequestSubscriberTest
@coversDefaultClass \Drupal\workspaces\EventSubscriber\WorkspaceRequestSubscriber

Namespace

Drupal\Tests\workspaces\Unit

Code

protected function setUp() {
  parent::setUp();
  $this->aliasManager = $this
    ->prophesize(AliasManagerInterface::class)
    ->reveal();
  $this->currentPath = $this
    ->prophesize(CurrentPathStack::class)
    ->reveal();
  $this->workspaceManager = $this
    ->prophesize(WorkspaceManagerInterface::class);
  $active_workspace = $this
    ->prophesize(WorkspaceInterface::class);
  $active_workspace
    ->id()
    ->willReturn('test');
  $this->workspaceManager
    ->getActiveWorkspace()
    ->willReturn($active_workspace
    ->reveal());
  $this->workspaceManager
    ->hasActiveWorkspace()
    ->willReturn(TRUE);
}