You are here

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

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

Tests the supportsNormalization() method.

@covers ::supportsNormalization

File

tests/src/Unit/InstantArticleRssContentEntityNormalizerTest.php, line 26

Class

InstantArticleRssContentEntityNormalizerTest
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
    ->assertFalse($normalizer
    ->supportsNormalization($content_entity, 'fbia'));
  $this
    ->assertTrue($normalizer
    ->supportsNormalization($content_entity, 'fbia_rss'));
  $this
    ->assertFalse($normalizer
    ->supportsNormalization($content_entity, 'json'));
  $this
    ->assertFalse($normalizer
    ->supportsNormalization($config_entity, 'fbia'));
}