function EntityRepositoryTest::setUp

Same name in this branch
  1. 10 core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php \Drupal\KernelTests\Core\Entity\EntityRepositoryTest::setUp()
Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php \Drupal\KernelTests\Core\Entity\EntityRepositoryTest::setUp()
  2. 9 core/tests/Drupal/Tests/Core/Entity/EntityRepositoryTest.php \Drupal\Tests\Core\Entity\EntityRepositoryTest::setUp()
  3. 8.9.x core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php \Drupal\KernelTests\Core\Entity\EntityRepositoryTest::setUp()
  4. 8.9.x core/tests/Drupal/Tests/Core/Entity/EntityRepositoryTest.php \Drupal\Tests\Core\Entity\EntityRepositoryTest::setUp()
  5. 11.x core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php \Drupal\KernelTests\Core\Entity\EntityRepositoryTest::setUp()
  6. 11.x core/tests/Drupal/Tests/Core/Entity/EntityRepositoryTest.php \Drupal\Tests\Core\Entity\EntityRepositoryTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Entity/EntityRepositoryTest.php, line 54

Class

EntityRepositoryTest
@coversDefaultClass \Drupal\Core\Entity\EntityRepository @group Entity

Namespace

Drupal\Tests\Core\Entity

Code

protected function setUp() : void {
    parent::setUp();
    $this->entityTypeManager = $this->prophesize(EntityTypeManagerInterface::class);
    $this->languageManager = $this->prophesize(LanguageManagerInterface::class);
    $this->contextRepository = $this->prophesize(ContextRepositoryInterface::class);
    $this->entityRepository = new EntityRepository($this->entityTypeManager
        ->reveal(), $this->languageManager
        ->reveal(), $this->contextRepository
        ->reveal());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.