You are here

public function NullNormalizerTest::testSupportsNormalization in Drupal 10

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

@covers ::__construct @covers ::supportsNormalization

File

core/modules/serialization/tests/src/Unit/Normalizer/NullNormalizerTest.php, line 39

Class

NullNormalizerTest
@coversDefaultClass \Drupal\serialization\Normalizer\NullNormalizer @group serialization

Namespace

Drupal\Tests\serialization\Unit\Normalizer

Code

public function testSupportsNormalization() {
  $mock = $this
    ->createMock('Drupal\\Core\\TypedData\\TypedDataInterface');
  $this
    ->assertTrue($this->normalizer
    ->supportsNormalization($mock));

  // Also test that an object not implementing TypedDataInterface fails.
  $this
    ->assertFalse($this->normalizer
    ->supportsNormalization(new \stdClass()));
}