function FieldNormalizerDenormalizeExceptionsUnitTest::testFieldNormalizerDenormalizeExceptions

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

@dataProvider providerNormalizerDenormalizeExceptions

Parameters

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

File

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

Class

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

Namespace

Drupal\Tests\hal\Unit

Code

public function testFieldNormalizerDenormalizeExceptions($context) {
    $field_item_normalizer = new FieldNormalizer();
    $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.