You are here

public function InstantArticleContentEntityNormalizerTest::testSupportsNormalization in Facebook Instant Articles 3.x

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/InstantArticleContentEntityNormalizerTest.php \Drupal\Tests\fb_instant_articles\Unit\InstantArticleContentEntityNormalizerTest::testSupportsNormalization()

Tests the supportsNormalization() method.

@covers ::supportsNormalization

File

tests/src/Unit/InstantArticleContentEntityNormalizerTest.php, line 34

Class

InstantArticleContentEntityNormalizerTest
Tests the fbia content entity normalizer class.

Namespace

Drupal\Tests\fb_instant_articles\Unit

Code

public function testSupportsNormalization() {
  $content_entity = $this
    ->getMockBuilder(ContentEntityInterface::class)
    ->disableOriginalConstructor()
    ->getMock();
  $config_entity = $this
    ->getMockBuilder(ConfigEntityInterface::class)
    ->disableOriginalConstructor()
    ->getMock();
  $normalizer = $this
    ->getContentEntityNormalizer();
  $this
    ->assertTrue($normalizer
    ->supportsNormalization($content_entity, 'fbia'));
  $this
    ->assertFalse($normalizer
    ->supportsNormalization($content_entity, 'json'));
  $this
    ->assertFalse($normalizer
    ->supportsNormalization($config_entity, 'fbia'));
}