public function TimestampItemNormalizerTest::testSupportsDenormalization in Drupal 8
Same name and namespace in other branches
- 9 core/modules/serialization/tests/src/Unit/Normalizer/TimestampItemNormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\TimestampItemNormalizerTest::testSupportsDenormalization()
- 10 core/modules/serialization/tests/src/Unit/Normalizer/TimestampItemNormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\TimestampItemNormalizerTest::testSupportsDenormalization()
@covers ::supportsDenormalization
File
- core/
modules/ serialization/ tests/ src/ Unit/ Normalizer/ TimestampItemNormalizerTest.php, line 61
Class
- TimestampItemNormalizerTest
- Tests that TimestampItem (de)normalization uses Timestamp (de)normalization.
Namespace
Drupal\Tests\serialization\Unit\NormalizerCode
public function testSupportsDenormalization() {
$timestamp_item = $this
->createTimestampItemProphecy();
$this
->assertTrue($this->normalizer
->supportsDenormalization($timestamp_item
->reveal(), TimestampItem::class));
// CreatedItem extends regular TimestampItem.
$timestamp_item = $this
->prophesize(CreatedItem::class);
$this
->assertTrue($this->normalizer
->supportsDenormalization($timestamp_item
->reveal(), TimestampItem::class));
$entity_ref_item = $this
->prophesize(EntityReferenceItem::class);
$this
->assertFalse($this->normalizer
->supportsNormalization($entity_ref_item
->reveal(), TimestampItem::class));
}