/**
  * Tests the getWorkspaceSwitchLinks() method.
  */
 public function testGetWorkspaceSwitchLinks()
 {
     $second_machine_name = $this->values[1]['machine_name'];
     $url = Url::fromRoute($this->path);
     $expected_links = [1 => ['url' => $url, 'title' => $this->defaultMachineName, 'query' => ['workspace' => 1], 'attributes' => ['class' => ['session-active']]], 2 => ['url' => $url, 'title' => $second_machine_name, 'query' => ['workspace' => 2]]];
     foreach ($this->values as $key => $value) {
         $this->entities[$key]->expects($this->any())->method('id')->will($this->returnValue($value['id']));
         $this->entities[$key]->expects($this->any())->method('label')->will($this->returnValue($value['label']));
     }
     $this->negotiator = $this->getMock('\\Drupal\\multiversion\\Workspace\\SessionWorkspaceNegotiator');
     $this->negotiator->expects($this->any())->method('getActiveWorkspace')->with($this->requestStack, $this->entityManager)->will($this->returnValue($this->defaultMachineName));
     $storage = $this->getMock('\\Drupal\\Core\\Entity\\EntityStorageInterface');
     $storage->expects($this->any())->method('loadMultiple')->with()->will($this->returnValue($this->entities));
     $this->entityManager->expects($this->any())->method('getStorage')->with('workspace')->will($this->returnValue($storage));
     $this->workspaceManager->expects($this->any())->method('loadMultiple')->with()->will($this->returnValue(array($this->entities)));
     $workspace_manager = new WorkspaceManager($this->requestStack, $this->entityManager, $this->cacheRender);
     $workspace_manager->addNegotiator($this->workspaceNegotiator, 1);
     $workspace_manager->setActiveWorkspace($this->entities[0]);
     $negotiator = new SessionWorkspaceNegotiator();
     $negotiator->setWorkspaceManager($workspace_manager);
     $links = $negotiator->getWorkspaceSwitchLinks($this->request, $url);
     $this->assertSame($expected_links, $links);
 }