protected function EntityLinkTest::setUp in Drupal 9
Same name and namespace in other branches
- 8 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 41
Class
- EntityLinkTest
- @coversDefaultClass \Drupal\Core\Entity\EntityBase @group Entity
Namespace
Drupal\Tests\Core\EntityCode
protected function setUp() : void {
parent::setUp();
$this->entityTypeManager = $this
->createMock(EntityTypeManagerInterface::class);
$this->linkGenerator = $this
->createMock('Drupal\\Core\\Utility\\LinkGeneratorInterface');
$this->languageManager = $this
->createMock('Drupal\\Core\\Language\\LanguageManagerInterface');
$container = new ContainerBuilder();
$container
->set('entity_type.manager', $this->entityTypeManager);
$container
->set('link_generator', $this->linkGenerator);
$container
->set('language_manager', $this->languageManager);
\Drupal::setContainer($container);
}