class ModuleInfoTest
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/Extension/ModuleInfoTest.php \Drupal\Tests\Core\Extension\ModuleInfoTest
- 10 core/tests/Drupal/Tests/Core/Extension/ModuleInfoTest.php \Drupal\Tests\Core\Extension\ModuleInfoTest
Tests that core module info files have the expected keys.
@group Extension
Hierarchy
- class \Drupal\Tests\UnitTestCase uses \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\Core\Extension\ModuleInfoTest uses \Drupal\KernelTests\FileSystemModuleDiscoveryDataProviderTrait implements \Drupal\Tests\UnitTestCase
Expanded class hierarchy of ModuleInfoTest
File
-
core/
tests/ Drupal/ Tests/ Core/ Extension/ ModuleInfoTest.php, line 14
Namespace
Drupal\Tests\Core\ExtensionView source
class ModuleInfoTest extends UnitTestCase {
use FileSystemModuleDiscoveryDataProviderTrait;
/**
* Tests that core module info files have the expected keys.
*
* @dataProvider coreModuleListDataProvider
*/
public function testModuleInfo($module) {
$module_directory = __DIR__ . '/../../../../../modules/' . $module;
$info = Yaml::decode(file_get_contents($module_directory . '/' . $module . '.info.yml'));
$this->assertArrayHasKey('version', $info);
$this->assertEquals('VERSION', $info['version']);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.