WebformStatesManagerTest.php in Webform 6.x
File
tests/src/Functional/States/WebformStatesManagerTest.php
View source
<?php
namespace Drupal\Tests\webform\Functional\States;
use Drupal\Tests\webform\Functional\WebformBrowserTestBase;
class WebformStatesManagerTest extends WebformBrowserTestBase {
public static $modules = [
'webform',
'webform_test_states',
];
protected static $testWebforms = [
'test_states_to_text',
];
public function testStatesToText() {
$this
->drupalGet('/webform/test_states_to_text/confirmation');
$this
->assertRaw('<label>textfield_and</label>');
$this
->assertRaw('This element is <strong>required</strong> when <strong>all</strong> of the following conditions are met:<ul><li><strong>some_trigger</strong> is checked.</li><li><strong>some_value</strong> = <strong>one</strong>.</li><li><strong>some_number</strong> >= <strong>1</strong>.</li></ul>');
$this
->assertRaw('<label>textfield_or</label>');
$this
->assertRaw('This element is <strong>required</strong> when <strong>any</strong> of the following conditions are met:<ul><li><strong>some_trigger</strong> is checked.</li><li><strong>some_value</strong> = <strong>one</strong>.</li><li><strong>some_number</strong> >= <strong>1</strong>.</li></ul>');
$this
->assertRaw('<label>textfield_or</label>');
$this
->assertRaw('This element is <strong>required</strong> when <strong>any</strong> of the following conditions are met:<ul><li><strong>some_trigger</strong> is not checked.</li><li>When <strong>any</strong> of the following (nested) conditions are met:<ul><li><strong>some_value</strong> = <strong>one</strong>.</li><li><strong>some_number</strong> is between <strong>1</strong> and <strong>10</strong>.</li></ul></li></ul>');
}
}