You are here

public function TimestampItemNormalizerTest::testSupportsNormalization in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/serialization/tests/src/Unit/Normalizer/TimestampItemNormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\TimestampItemNormalizerTest::testSupportsNormalization()
  2. 10 core/modules/serialization/tests/src/Unit/Normalizer/TimestampItemNormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\TimestampItemNormalizerTest::testSupportsNormalization()

@covers ::supportsNormalization

File

core/modules/serialization/tests/src/Unit/Normalizer/TimestampItemNormalizerTest.php, line 50

Class

TimestampItemNormalizerTest
Tests that TimestampItem (de)normalization uses Timestamp (de)normalization.

Namespace

Drupal\Tests\serialization\Unit\Normalizer

Code

public function testSupportsNormalization() {
  $timestamp_item = $this
    ->createTimestampItemProphecy();
  $this
    ->assertTrue($this->normalizer
    ->supportsNormalization($timestamp_item
    ->reveal()));
  $entity_ref_item = $this
    ->prophesize(EntityReferenceItem::class);
  $this
    ->assertFalse($this->normalizer
    ->supportsNormalization($entity_ref_item
    ->reveal()));
}