You are here

protected function EntityLinkTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php \Drupal\Tests\Core\Entity\EntityLinkTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php, line 45
Contains \Drupal\Tests\Core\Entity\EntityLinkTest.

Class

EntityLinkTest
@coversDefaultClass \Drupal\Core\Entity\Entity @group Entity

Namespace

Drupal\Tests\Core\Entity

Code

protected function setUp() {
  parent::setUp();
  $this->entityManager = $this
    ->getMock('Drupal\\Core\\Entity\\EntityManagerInterface');
  $this->linkGenerator = $this
    ->getMock('Drupal\\Core\\Utility\\LinkGeneratorInterface');
  $this->languageManager = $this
    ->getMock('Drupal\\Core\\Language\\LanguageManagerInterface');
  $container = new ContainerBuilder();
  $container
    ->set('entity.manager', $this->entityManager);
  $container
    ->set('link_generator', $this->linkGenerator);
  $container
    ->set('language_manager', $this->languageManager);
  \Drupal::setContainer($container);
}