public function FormStateTest::testFormStateFirstPageProcessed in Little helpers 7.2
Same name and namespace in other branches
- 7 tests/Webform/FormStateTest.php \Drupal\little_helpers\Test\Webform\FormStateTest::testFormStateFirstPageProcessed()
Test reading values after the first step was submitted.
File
- tests/
Webform/ FormStateTest.php, line 473
Class
- FormStateTest
- Test creating a submission object from various form states.
Namespace
Drupal\little_helpers\Test\WebformCode
public function testFormStateFirstPageProcessed() {
$form_state = $this
->formStateFirstPageProcessedStub();
$webform = new Webform($this->webformNode);
$submission = $webform
->formStateToSubmission($form_state);
$this
->assertEqual('Myfirstname', $submission
->valueByKey('first_name'));
$this
->assertEqual('01/1234568', $submission
->valueByCid(15));
$value_reference = array(
1 => 'Myfirstname',
15 => '01/1234568',
14 => NULL,
13 => NULL,
19 => NULL,
);
$this
->assertEqual($value_reference, $submission
->valuesByType('textfield'));
}