You are here

public function WebformYamlTest::testTidy in Webform 8.5

Same name and namespace in other branches
  1. 6.x tests/src/Unit/Utility/WebformYamlTest.php \Drupal\Tests\webform\Unit\Utility\WebformYamlTest::testTidy()

Tests WebformYaml tidy with WebformYaml::tidy().

@dataProvider providerTidy

Parameters

array $data: The array to run through WebformYaml::tidy().

string $expected: The expected result from calling the function.

See also

WebformYaml::tidy()

File

tests/src/Unit/Utility/WebformYamlTest.php, line 30

Class

WebformYamlTest
Tests webform tidy utility.

Namespace

Drupal\Tests\webform\Unit\Utility

Code

public function testTidy(array $data, $expected) {
  $result = WebformYaml::tidy(Yaml::encode($data));
  $this
    ->assertEquals($expected, $result);
}