NoHelpTest.php in Drupal 8
File
core/modules/help/tests/src/Functional/NoHelpTest.php
View source
<?php
namespace Drupal\Tests\help\Functional;
use Drupal\Tests\BrowserTestBase;
class NoHelpTest extends BrowserTestBase {
public static $modules = [
'help',
'menu_test',
];
protected $defaultTheme = 'stark';
protected $adminUser;
protected function setUp() {
parent::setUp();
$this->adminUser = $this
->drupalCreateUser([
'access administration pages',
]);
}
public function testMainPageNoHelp() {
$this
->drupalLogin($this->adminUser);
$this
->drupalGet('admin/help');
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertText('Module overviews are provided by modules');
$this
->assertFalse(\Drupal::moduleHandler()
->implementsHook('menu_test', 'help'), 'The menu_test module does not implement hook_help');
$this
->assertNoText(\Drupal::moduleHandler()
->getName('menu_test'), 'Making sure the test module menu_test does not display a help link on admin/help.');
$this
->drupalGet('admin/help/menu_test');
$this
->assertSession()
->statusCodeEquals(404);
}
}
Classes
Name |
Description |
NoHelpTest |
Verify no help is displayed for modules not providing any help. |