You are here

public function EntityConditionNormalizerTest::testDenormalize in JSON:API 8

@covers ::denormalize @dataProvider denormalizeProvider

File

tests/src/Kernel/Normalizer/EntityConditionNormalizerTest.php, line 41

Class

EntityConditionNormalizerTest
@coversDefaultClass \Drupal\jsonapi\Normalizer\EntityConditionNormalizer @group jsonapi @group jsonapi_normalizers @group legacy

Namespace

Drupal\Tests\jsonapi\Kernel\Normalizer

Code

public function testDenormalize($case) {
  $normalized = $this->normalizer
    ->denormalize($case, EntityCondition::class);
  $this
    ->assertEquals($case['path'], $normalized
    ->field());
  $this
    ->assertEquals($case['value'], $normalized
    ->value());
  if (isset($case['operator'])) {
    $this
      ->assertEquals($case['operator'], $normalized
      ->operator());
  }
}