function EntityNormalizerTest::testDenormalizeWithNoEntityType

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

Tests the denormalize() method with no entity type provided in context.

@covers ::denormalize

File

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

Class

EntityNormalizerTest
@coversDefaultClass \Drupal\serialization\Normalizer\EntityNormalizer @group serialization

Namespace

Drupal\Tests\serialization\Unit\Normalizer

Code

public function testDenormalizeWithNoEntityType() {
    $this->expectException(UnexpectedValueException::class);
    $this->entityNormalizer
        ->denormalize([], 'Drupal\\Core\\Entity\\ContentEntityBase');
}

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