You are here

public function TimestampNormalizerTest::testSupportsNormalization in Drupal 9

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

@covers ::supportsNormalization

File

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

Class

TimestampNormalizerTest
Unit test coverage for the "Timestamp" @DataType.

Namespace

Drupal\Tests\serialization\Unit\Normalizer

Code

public function testSupportsNormalization() {
  $this
    ->assertTrue($this->normalizer
    ->supportsNormalization($this->data
    ->reveal()));
  $integer = $this
    ->prophesize(IntegerData::class);
  $this
    ->assertFalse($this->normalizer
    ->supportsNormalization($integer
    ->reveal()));
  $datetime = $this
    ->prophesize(DateTimeInterface::class);
  $this
    ->assertFalse($this->normalizer
    ->supportsNormalization($datetime
    ->reveal()));
}