function EntityNormalizerTest::setUp

Same name and namespace in other branches
  1. 8.9.x core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\EntityNormalizerTest::setUp()
  2. 10 core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\EntityNormalizerTest::setUp()
  3. 11.x core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\EntityNormalizerTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php, line 58

Class

EntityNormalizerTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21serialization%21src%21Normalizer%21EntityNormalizer.php/class/EntityNormalizer/9" title="Normalizes/denormalizes Drupal entity objects into an array structure." class="local">\Drupal\serialization\Normalizer\EntityNormalizer</a> @group serialization

Namespace

Drupal\Tests\serialization\Unit\Normalizer

Code

protected function setUp() : void {
    $this->entityFieldManager = $this->createMock(EntityFieldManagerInterface::class);
    $this->entityTypeManager = $this->createMock(EntityTypeManagerInterface::class);
    $this->entityTypeRepository = $this->createMock(EntityTypeRepositoryInterface::class);
    $this->entityNormalizer = new EntityNormalizer($this->entityTypeManager, $this->entityTypeRepository, $this->entityFieldManager);
}

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