WebformFormValidateTest.php in Webform 8.5
File
tests/src/Functional/Form/WebformFormValidateTest.php
View source
<?php
namespace Drupal\Tests\webform\Functional\Form;
use Drupal\webform\Entity\Webform;
use Drupal\Tests\webform\Functional\WebformBrowserTestBase;
class WebformFormValidateTest extends WebformBrowserTestBase {
public static $modules = [
'webform',
'webform_test_validate',
];
protected static $testWebforms = [
'test_form_validate',
];
public function testValidate() {
$webform_validate = Webform::load('test_form_validate');
$this
->postSubmission($webform_validate, []);
$this
->assertRaw('Custom element is required.');
$this
->postSubmission($webform_validate, [
'custom' => 'value',
]);
$this
->assertNoRaw('Custom element is required.');
}
}