You are here

public function YamlFormTidyTest::testTidy in YAML Form 8

Tests YamlFormTidy tidy with YamlFormTidy::tidy().

@dataProvider providerTidy

Parameters

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

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

See also

YamlFormTidy::tidy()

File

tests/src/Unit/YamlFormTidyTest.php, line 30

Class

YamlFormTidyTest
Tests form tidy utility.

Namespace

Drupal\Tests\yamlform\Unit

Code

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