Same filename and directory in other branches
- 8.9.x core/modules/help/tests/src/Functional/NoHelpTest.php
- 9 core/modules/help/tests/src/Functional/NoHelpTest.php
Namespace
Drupal\Tests\help\Functional
File
core/modules/help/tests/src/Functional/NoHelpTest.php
View source
<?php
declare (strict_types=1);
namespace Drupal\Tests\help\Functional;
use Drupal\Tests\BrowserTestBase;
class NoHelpTest extends BrowserTestBase {
protected static $modules = [
'help',
'menu_test',
];
protected $defaultTheme = 'stark';
protected $adminUser;
protected function setUp() : void {
parent::setUp();
$this->adminUser = $this
->drupalCreateUser([
'access help pages',
]);
}
public function testMainPageNoHelp() {
$this
->drupalLogin($this->adminUser);
$this
->drupalGet('admin/help');
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertSession()
->pageTextContains('Module overviews are provided by modules');
$this
->assertFalse(\Drupal::moduleHandler()
->hasImplementations('help', 'menu_test'), 'The menu_test module does not implement hook_help');
$this
->assertSession()
->pageTextNotContains(\Drupal::service('extension.list.module')
->getName('menu_test'));
$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. |