class RequirementsTest
Same name in this branch
- 9 core/modules/mysql/tests/src/Functional/RequirementsTest.php \Drupal\Tests\mysql\Functional\RequirementsTest
Same name and namespace in other branches
- 11.x core/modules/file/tests/src/Kernel/RequirementsTest.php \Drupal\Tests\file\Kernel\RequirementsTest
- 11.x core/modules/mysql/tests/src/Functional/RequirementsTest.php \Drupal\Tests\mysql\Functional\RequirementsTest
- 11.x core/modules/system/tests/src/Kernel/Module/RequirementsTest.php \Drupal\Tests\system\Kernel\Module\RequirementsTest
- 10 core/modules/file/tests/src/Kernel/RequirementsTest.php \Drupal\Tests\file\Kernel\RequirementsTest
- 10 core/modules/mysql/tests/src/Functional/RequirementsTest.php \Drupal\Tests\mysql\Functional\RequirementsTest
- 10 core/modules/system/tests/src/Kernel/Module/RequirementsTest.php \Drupal\Tests\system\Kernel\Module\RequirementsTest
@covers \hook_requirements
@covers \hook_requirements_alter
@group Module
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\system\Kernel\Module\RequirementsTest extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of RequirementsTest
File
-
core/
modules/ system/ tests/ src/ Kernel/ Module/ RequirementsTest.php, line 12
Namespace
Drupal\Tests\system\Kernel\ModuleView source
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);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.