You are here

public function ModuleInfoTest::testModuleInfo in Drupal 9

Tests that core module info files have the expected keys.

@dataProvider coreModuleListDataProvider

File

core/tests/Drupal/Tests/Core/Extension/ModuleInfoTest.php, line 23

Class

ModuleInfoTest
Tests that core module info files have the expected keys.

Namespace

Drupal\Tests\Core\Extension

Code

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']);
}