class HelpEmptyPageTest in Drupal 10
Same name and namespace in other branches
- 8 core/modules/help/tests/src/Kernel/HelpEmptyPageTest.php \Drupal\Tests\help\Kernel\HelpEmptyPageTest
- 9 core/modules/help/tests/src/Kernel/HelpEmptyPageTest.php \Drupal\Tests\help\Kernel\HelpEmptyPageTest
Tests the empty HTML page.
@group help
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \PHPUnit\Framework\TestCase implements ServiceProviderInterface uses \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, AssertContentTrait, ConfigTestTrait, ExtensionListTestTrait, RandomGeneratorTrait, TestRequirementsTrait, PhpUnitWarnings
- class \Drupal\Tests\help\Kernel\HelpEmptyPageTest
Expanded class hierarchy of HelpEmptyPageTest
File
- core/
modules/ help/ tests/ src/ Kernel/ HelpEmptyPageTest.php, line 15
Namespace
Drupal\Tests\help\KernelView source
class HelpEmptyPageTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'system',
'help_test',
'user',
'path_alias',
];
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container) {
parent::register($container);
$container
->set('url_generator', new SupernovaGenerator());
}
/**
* Ensures that no URL generator is called on a page without hook_help().
*/
public function testEmptyHookHelp() {
$all_modules = \Drupal::service('extension.list.module')
->getList();
$all_modules = array_filter($all_modules, function ($module) {
// Filter contrib, hidden, already enabled modules and modules in the
// Testing package.
if ($module->origin !== 'core' || !empty($module->info['hidden']) || $module->status == TRUE || $module->info['package'] == 'Testing') {
return FALSE;
}
return TRUE;
});
$this
->enableModules(array_keys($all_modules));
$this
->installEntitySchema('menu_link_content');
$route = \Drupal::service('router.route_provider')
->getRouteByName('<front>');
\Drupal::service('module_handler')
->invokeAll('help', [
'<front>',
new RouteMatch('<front>', $route),
]);
}
}