You are here

protected function ComposerProjectTemplatesTest::assertDrupalVersion in Drupal 9

Assert that the VERSION constant in Drupal.php is the expected value.

Parameters

string $expectedVersion:

string $dir:

1 call to ComposerProjectTemplatesTest::assertDrupalVersion()
ComposerProjectTemplatesTest::testTemplateCreateProject in core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php
@dataProvider provideTemplateCreateProject

File

core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php, line 261

Class

ComposerProjectTemplatesTest
Demonstrate that Composer project templates are buildable as patched.

Namespace

Drupal\BuildTests\Composer\Template

Code

protected function assertDrupalVersion($expectedVersion, $dir) {
  $drupal_php_path = $dir . '/core/lib/Drupal.php';
  $this
    ->assertFileExists($drupal_php_path);

  // Read back the Drupal version that was set and assert it matches expectations.
  $this
    ->executeCommand("php -r 'include \"{$drupal_php_path}\"; print \\Drupal::VERSION;'");
  $this
    ->assertCommandSuccessful();
  $this
    ->assertCommandOutputContains($expectedVersion);
}