You are here

public function WorkspaceManagerTest::testAddNegotiator in Multiversion 8

Tests the addNegotiator() method.

File

tests/src/Unit/WorkspaceManagerTest.php, line 144

Class

WorkspaceManagerTest
@coversDefaultClass \Drupal\multiversion\Workspace\WorkspaceManager @group multiversion

Namespace

Drupal\Tests\multiversion\Unit

Code

public function testAddNegotiator() {
  $workspace_manager = new WorkspaceManager($this->requestStack, $this->entityTypeManager, $this->currentUser, $this->logger);
  $workspace_manager
    ->addNegotiator($this->workspaceNegotiators[0][0], 0);
  $workspace_manager
    ->addNegotiator($this->workspaceNegotiators[1][0], 1);
  $property = new \ReflectionProperty('Drupal\\multiversion\\Workspace\\WorkspaceManager', 'negotiators');
  $property
    ->setAccessible(TRUE);
  $this
    ->assertSame($this->workspaceNegotiators, $property
    ->getValue($workspace_manager));
}