You are here

public function WebformFormHelperTest::testCleanupFormStateValues in Webform 8.5

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

Tests WebformFormHelper::cleanupFormStateValues().

@dataProvider providerCleanupFormStateValues

Parameters

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

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

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

See also

WebformFormHelper::cleanupFormStateValues()

File

tests/src/Unit/Utility/WebformFormHelperTest.php, line 31

Class

WebformFormHelperTest
Tests webform helper utility.

Namespace

Drupal\Tests\webform\Unit\Utility

Code

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