You are here

public function PatternPreviewTest::testPreviewMarkup in UI Patterns 8

Test getPreviewMarkup.

@covers ::getPreviewMarkup

File

tests/src/Unit/Element/PatternPreviewTest.php, line 21

Class

PatternPreviewTest
@coversDefaultClass \Drupal\ui_patterns\Element\PatternPreview

Namespace

Drupal\Tests\ui_patterns\Unit\Element

Code

public function testPreviewMarkup() {
  $assertions = Yaml::decode(file_get_contents($this
    ->getFixturePath() . '/preview_markup.yml'));
  foreach ($assertions as $assertion) {
    $result = PatternPreview::getPreviewMarkup($assertion['actual']);
    $this
      ->assertEquals($assertion['expected'], $result);
  }
}