$form_state =
new FormState();
$form_state->
setCleanValueKeys(['key1', 'key2'
]);
$this->
assertSame($form_state->
getCleanValueKeys(),
['key1', 'key2'
]);
} /**
* @covers ::addCleanValueKey
*/
public function testAddCleanValueKey() { $form_state =
new FormState();
$form_state->
setValue('value_to_clean', 'rainbow_sprinkles'
);
$form_state->
addCleanValueKey('value_to_clean'
);
$this->
assertSame($form_state->
getCleanValueKeys(),
['form_id', 'form_token', 'form_build_id', 'op', 'value_to_clean'
]);
return $form_state;
} /**
* @depends testAddCleanValueKey
*
* @covers ::cleanValues
*/
public function testCleanValues($form_state) { $form_state->
setValue('value_to_keep', 'magic_ponies'
);