You are here

public function YamlFormHelperTest::testCleanupFormStateValues in YAML Form 8

Tests YamlFormHelper with YamlFormHelper::cleanupFormStateValues().

@dataProvider providerCleanupFormStateValues

Parameters

array $values: The array to run through YamlFormHelper::cleanupFormStateValues().

array $keys: (optional) An array of custom keys to be removed.

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

See also

YamlFormHelper::cleanupFormStateValues()

File

tests/src/Unit/YamlFormHelperTest.php, line 31

Class

YamlFormHelperTest
Tests form helper utility.

Namespace

Drupal\Tests\yamlform\Unit

Code

public function testCleanupFormStateValues(array $values, array $keys, $expected) {
  $result = YamlFormHelper::cleanupFormStateValues($values, $keys);
  $this
    ->assertEquals($expected, $result);
}