FieldNormalizerDenormalizeExceptionsUnitTest.php

Namespace

Drupal\Tests\hal\Unit

File

core/modules/hal/tests/src/Unit/FieldNormalizerDenormalizeExceptionsUnitTest.php

View source
<?php

namespace Drupal\Tests\hal\Unit;

use Drupal\hal\Normalizer\FieldNormalizer;
use Symfony\Component\Serializer\Exception\InvalidArgumentException;

/**
 * @coversDefaultClass \Drupal\hal\Normalizer\FieldNormalizer
 * @group hal
 */
class FieldNormalizerDenormalizeExceptionsUnitTest extends NormalizerDenormalizeExceptionsUnitTestBase {
    
    /**
     * Tests that the FieldNormalizer::denormalize() throws proper exceptions.
     *
     * @param array $context
     *   Context for FieldNormalizer::denormalize().
     *
     * @dataProvider providerNormalizerDenormalizeExceptions
     */
    public function testFieldNormalizerDenormalizeExceptions($context) {
        $field_item_normalizer = new FieldNormalizer();
        $data = [];
        $class = [];
        $this->expectException(InvalidArgumentException::class);
        $field_item_normalizer->denormalize($data, $class, NULL, $context);
    }

}

Classes

Title Deprecated Summary
FieldNormalizerDenormalizeExceptionsUnitTest @coversDefaultClass \Drupal\hal\Normalizer\FieldNormalizer @group hal

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.