3 namespace Drupal\Tests\hal\Unit;
5 use Drupal\hal\Normalizer\FieldItemNormalizer;
6 use Symfony\Component\Serializer\Exception\InvalidArgumentException;
9 * @coversDefaultClass \Drupal\hal\Normalizer\FieldItemNormalizer
12 class FieldItemNormalizerDenormalizeExceptionsUnitTest extends NormalizerDenormalizeExceptionsUnitTestBase {
15 * Tests that the FieldItemNormalizer::denormalize() throws proper exceptions.
17 * @param array $context
18 * Context for FieldItemNormalizer::denormalize().
20 * @dataProvider providerNormalizerDenormalizeExceptions
22 public function testFieldItemNormalizerDenormalizeExceptions($context) {
23 $field_item_normalizer = new FieldItemNormalizer();
26 $this->setExpectedException(InvalidArgumentException::class);
27 $field_item_normalizer->denormalize($data, $class, NULL, $context);