Version 1
[yaffs-website] / web / core / modules / hal / tests / src / Unit / FieldItemNormalizerDenormalizeExceptionsUnitTest.php
1 <?php
2
3 namespace Drupal\Tests\hal\Unit;
4
5 use Drupal\hal\Normalizer\FieldItemNormalizer;
6 use Symfony\Component\Serializer\Exception\InvalidArgumentException;
7
8 /**
9  * @coversDefaultClass \Drupal\hal\Normalizer\FieldItemNormalizer
10  * @group hal
11  */
12 class FieldItemNormalizerDenormalizeExceptionsUnitTest extends NormalizerDenormalizeExceptionsUnitTestBase {
13
14   /**
15    * Tests that the FieldItemNormalizer::denormalize() throws proper exceptions.
16    *
17    * @param array $context
18    *   Context for FieldItemNormalizer::denormalize().
19    *
20    * @dataProvider providerNormalizerDenormalizeExceptions
21    */
22   public function testFieldItemNormalizerDenormalizeExceptions($context) {
23     $field_item_normalizer = new FieldItemNormalizer();
24     $data = [];
25     $class = [];
26     $this->setExpectedException(InvalidArgumentException::class);
27     $field_item_normalizer->denormalize($data, $class, NULL, $context);
28   }
29
30 }