You are here

public function DenormalizeTest::testTypeHandlingWithNoTypes in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/hal/tests/src/Kernel/DenormalizeTest.php \Drupal\Tests\hal\Kernel\DenormalizeTest::testTypeHandlingWithNoTypes()

Tests link relation handling with no types.

File

core/modules/hal/tests/src/Kernel/DenormalizeTest.php, line 96

Class

DenormalizeTest
Tests HAL denormalization edge cases for EntityResource.

Namespace

Drupal\Tests\hal\Kernel

Code

public function testTypeHandlingWithNoTypes() {
  $data_with_no_types = [
    '_links' => [
      'type' => [],
    ],
  ];
  $this
    ->expectException(UnexpectedValueException::class);
  $this->serializer
    ->denormalize($data_with_no_types, $this->entityClass, $this->format);
}