function FieldItemNormalizerDenormalizeExceptionsUnitTest::testFieldItemNormalizerDenormalizeExceptions

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

@dataProvider providerNormalizerDenormalizeExceptions

Parameters

array $context: Context for FieldItemNormalizer::denormalize().

File

core/modules/hal/tests/src/Unit/FieldItemNormalizerDenormalizeExceptionsUnitTest.php, line 22

Class

FieldItemNormalizerDenormalizeExceptionsUnitTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21hal%21src%21Normalizer%21FieldItemNormalizer.php/class/FieldItemNormalizer/8.9.x" title="Converts the Drupal field item object structure to HAL array structure." class="local">\Drupal\hal\Normalizer\FieldItemNormalizer</a> @group hal

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.