RequirementsTest.php
Same filename in this branch
Same filename in other branches
- 10 core/modules/file/tests/src/Kernel/RequirementsTest.php
- 10 core/modules/mysql/tests/src/Functional/RequirementsTest.php
- 10 core/modules/system/tests/src/Kernel/Module/RequirementsTest.php
- 11.x core/modules/file/tests/src/Kernel/RequirementsTest.php
- 11.x core/modules/mysql/tests/src/Functional/RequirementsTest.php
- 11.x core/modules/system/tests/src/Kernel/Module/RequirementsTest.php
Namespace
Drupal\Tests\system\Kernel\ModuleFile
-
core/
modules/ system/ tests/ src/ Kernel/ Module/ RequirementsTest.php
View source
<?php
namespace Drupal\Tests\system\Kernel\Module;
use Drupal\KernelTests\KernelTestBase;
/**
* @covers \hook_requirements
* @covers \hook_requirements_alter
* @group Module
*/
class RequirementsTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'requirements1_test',
'system',
];
/**
* Tests requirements data altering.
*/
public function testRequirementsAlter() : void {
$requirements = $this->container
->get('system.manager')
->listRequirements();
// @see requirements1_test_requirements_alter()
$this->assertEquals('Requirements 1 Test - Changed', $requirements['requirements1_test_alterable']['title']);
$this->assertEquals(REQUIREMENT_WARNING, $requirements['requirements1_test_alterable']['severity']);
$this->assertArrayNotHasKey('requirements1_test_deletable', $requirements);
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
RequirementsTest | @covers \hook_requirements @covers \hook_requirements_alter @group Module |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.