You are here

public function InstantArticleContentEntityNormalizerTest::testSortComponents 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::testSortComponents()

Tests the sortComponents() method.

@dataProvider sortComponentsProvider @covers ::sortComponents

File

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

Class

InstantArticleContentEntityNormalizerTest
Tests the fbia content entity normalizer class.

Namespace

Drupal\Tests\fb_instant_articles\Unit

Code

public function testSortComponents($components, $expected) {
  uasort($components, [
    InstantArticleContentEntityNormalizer::class,
    'sortComponents',
  ]);

  // Re-key the array for equality check.
  $components = array_values($components);
  $this
    ->assertEquals($expected, $components);
}