function FieldNormalizerDenormalizeExceptionsTest::testFieldItemNormalizerDenormalizeExceptions

Tests that the FieldItemNormalizer::denormalize() throws proper exceptions.

@covers \Drupal\hal\Normalizer\FieldItemNormalizer

@dataProvider providerNormalizerDenormalizeExceptions

File

core/modules/hal/tests/src/Unit/FieldNormalizerDenormalizeExceptionsTest.php, line 40

Class

FieldNormalizerDenormalizeExceptionsTest
Tests the exceptions thrown by FieldNormalizer and FieldItemNormalizer.

Namespace

Drupal\Tests\hal\Unit

Code

public function testFieldItemNormalizerDenormalizeExceptions($context) {
    $field_item_normalizer = new FieldItemNormalizer();
    $data = [];
    $class = [];
    $this->expectException(InvalidArgumentException::class);
    $field_item_normalizer->denormalize($data, $class, NULL, $context);
}

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