You are here

public function DateTimeIso8601NormalizerTest::testSupportsNormalization in Drupal 9

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

@covers ::supportsNormalization

File

core/modules/serialization/tests/src/Unit/Normalizer/DateTimeIso8601NormalizerTest.php, line 65

Class

DateTimeIso8601NormalizerTest
Unit test coverage for the "datetime_iso8601" @DataType.

Namespace

Drupal\Tests\serialization\Unit\Normalizer

Code

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