You are here

public function WebformYamlTest::testTidy in Webform 6.x

Same name and namespace in other branches
  1. 8.5 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);
}