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