WebformHelpTest.php in Webform 8.5
File
tests/src/Functional/WebformHelpTest.php
View source
<?php
namespace Drupal\Tests\webform\Functional;
class WebformHelpTest extends WebformBrowserTestBase {
public static $modules = [
'block',
'help',
'webform_test_message_custom',
];
protected function setUp() {
parent::setUp();
$this
->drupalPlaceBlock('help_block');
}
public function testHelp() {
$this
->drupalLogin($this->rootUser);
$this
->drupalGet('/admin/structure/webform');
$this
->assertRaw('This is a warning notification.');
$this
->assertRaw('This is an info notification.');
$this
->assertRaw('If you enjoy and value Drupal and the Webform module consider');
$this
->drupalGet('/admin/structure/webform');
$this
->clickLink('×', 0);
$this
->drupalGet('/admin/structure/webform');
$this
->clickLink('×', 0);
$this
->drupalGet('/admin/structure/webform');
$this
->clickLink('×', 0);
$this
->drupalGet('/admin/structure/webform');
$this
->assertNoRaw('This is a warning notification.');
$this
->assertNoRaw('This is an info notification.');
$this
->assertNoRaw('If you enjoy and value Drupal and the Webform module consider');
$this
->drupalGet('/admin/structure/webform/config/advanced');
$this
->assertPattern('#<div id="block-[^"]+" role="complementary">#');
$this
->assertRaw('The <strong>Advanced configuration</strong> page allows an administrator to enable/disable UI behaviors, manage requirements and define data used for testing webforms.');
$this
->drupalPostForm('/admin/structure/webform/config/advanced', [
'ui[help_disabled]' => TRUE,
], 'Save configuration');
$this
->drupalGet('/admin/structure/webform/config/advanced');
$this
->assertNoPattern('#<div id="block-[^"]+" role="complementary">#');
$this
->assertNoRaw('The <strong>Advanced configuration</strong> page allows an administrator to enable/disable UI behaviors, manage requirements and define data used for testing webforms.');
}
}