WebformElementMarkupTest.php in Webform 6.x
File
tests/src/Functional/Element/WebformElementMarkupTest.php
View source
<?php
namespace Drupal\Tests\webform\Functional\Element;
class WebformElementMarkupTest extends WebformElementBrowserTestBase {
public static $modules = [
'webform',
'webform_test_markup',
];
protected static $testWebforms = [
'test_element_markup',
];
public function testMarkup() {
$this
->drupalGet('/webform/test_element_markup');
$this
->assertCssSelect('.js-form-item-markup.form-item-markup.form-no-label');
$this
->assertRaw('<p>This is normal markup</p>');
$this
->assertRaw('<p>This is only displayed on the form view.</p>');
$this
->assertNoRaw('<p>This is only displayed on the submission view.</p>');
$this
->assertRaw('<p>This is displayed on the both the form and submission view.</p>');
$this
->assertRaw('<p>This is displayed on the both the form and submission view.</p>');
$this
->drupalGet('/webform/test_element_markup');
$this
->assertNoRaw('<p>Alter this markup.</p>');
$this
->assertRaw('<p><em>Alter this markup.</em> <strong>This markup was altered.</strong></p>');
$this
->drupalPostForm('/webform/test_element_markup', [], 'Preview');
$this
->assertNoRaw('<p>This is normal markup</p>');
$this
->assertNoRaw('<p>This is only displayed on the form view.</p>');
$this
->assertRaw('<p>This is only displayed on the submission view.</p>');
$this
->assertRaw('<p>This is displayed on the both the form and submission view.</p>');
}
}