WebformElementCheckboxValueTest.php in Webform 8.5
File
tests/src/Functional/Element/WebformElementCheckboxValueTest.php
View source
<?php
namespace Drupal\Tests\webform\Functional\Element;
use Drupal\webform\Entity\Webform;
class WebformElementCheckboxValueTest extends WebformElementBrowserTestBase {
protected static $testWebforms = [
'test_element_checkbox_value',
];
public function testCheckboxValue() {
$webform = Webform::load('test_element_checkbox_value');
$this
->postSubmission($webform);
$this
->assertRaw("checkbox_value_empty: ''\ncheckbox_value_filled: '{default_value}'\ncheckbox_value_select_other: Four");
$edit = [
'checkbox_value_empty[checkbox]' => TRUE,
];
$this
->postSubmission($webform, $edit);
$this
->assertRaw('Enter a value field is required.');
}
}