You are here

public function ModuleInfoTest::testModuleInfo in Drupal 10

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Extension/ModuleInfoTest.php \Drupal\Tests\Core\Extension\ModuleInfoTest::testModuleInfo()

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