HookRequirementsTest.php in Drupal 9
File
core/modules/system/tests/src/Functional/Module/HookRequirementsTest.php
View source
<?php
namespace Drupal\Tests\system\Functional\Module;
class HookRequirementsTest extends ModuleTestBase {
protected $defaultTheme = 'stark';
public function testHookRequirementsFailure() {
$this
->assertModules([
'requirements1_test',
], FALSE);
$edit = [];
$edit['modules[requirements1_test][enable]'] = 'requirements1_test';
$this
->drupalGet('admin/modules');
$this
->submitForm($edit, 'Install');
$this
->assertSession()
->pageTextContains('Requirements 1 Test failed requirements');
$this
->assertModules([
'requirements1_test',
], FALSE);
}
}