function DenormalizeTest::testTypeHandlingWithNoTypes

Same name and namespace in other branches
  1. 8.9.x 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 97

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);
}

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