function EntityUnitTest::setupTestLoad

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php \Drupal\Tests\Core\Entity\EntityUnitTest::setupTestLoad()
  2. 10 core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php \Drupal\Tests\Core\Entity\EntityUnitTest::setupTestLoad()
  3. 9 core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php \Drupal\Tests\Core\Entity\EntityUnitTest::setupTestLoad()
  4. 8.9.x core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php \Drupal\Tests\Core\Entity\EntityUnitTest::setupTestLoad()

Setup for the tests of the ::load() method.

3 calls to EntityUnitTest::setupTestLoad()
EntityUnitTest::testCreate in core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php
Tests create.
EntityUnitTest::testLoad in core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php
Tests EntityBase::load().
EntityUnitTest::testLoadMultiple in core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php
Tests EntityBase::loadMultiple().

File

core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php, line 244

Class

EntityUnitTest
Tests Drupal\Core\Entity\EntityBase.

Namespace

Drupal\Tests\Core\Entity

Code

public function setupTestLoad() : void {
  // Base our test entity on a real entity class so we can test if calling
  // EntityBase::load() on the base class will bubble up to an actual entity.
  $this->entityTypeId = 'stub_entity_base';
  $this->entity = new StubEntityBase([], $this->entityTypeId);
}

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