function DateTimeNormalizerTest::testSupportsNormalization

Same name in other branches
  1. 9 core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\DateTimeNormalizerTest::testSupportsNormalization()
  2. 10 core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\DateTimeNormalizerTest::testSupportsNormalization()
  3. 11.x core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\DateTimeNormalizerTest::testSupportsNormalization()

@covers ::supportsNormalization

File

core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php, line 58

Class

DateTimeNormalizerTest
Unit test coverage for @DataTypes implementing DateTimeInterface.

Namespace

Drupal\Tests\serialization\Unit\Normalizer

Code

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

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