function ComposerTest::testEnsureComposerVersion

Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/Tests/Composer/ComposerTest.php \Drupal\Tests\Composer\ComposerTest::testEnsureComposerVersion()
  2. 10 core/tests/Drupal/Tests/Composer/ComposerTest.php \Drupal\Tests\Composer\ComposerTest::testEnsureComposerVersion()
  3. 11.x core/tests/Drupal/Tests/Composer/ComposerTest.php \Drupal\Tests\Composer\ComposerTest::testEnsureComposerVersion()

Verify that Composer::ensureComposerVersion() doesn't break.

@covers::ensureComposerVersion

File

core/tests/Drupal/Tests/Composer/ComposerTest.php, line 19

Class

ComposerTest
@coversDefaultClass <a href="/api/drupal/composer%21Composer.php/class/Composer/9" title="Provides static functions for composer script events." class="local">\Drupal\Composer\Composer</a> @group Composer

Namespace

Drupal\Tests\Composer

Code

public function testEnsureComposerVersion() {
    try {
        $this->assertNull(Composer::ensureComposerVersion());
    } catch (\RuntimeException $e) {
        $this->assertMatchesRegularExpression('/Drupal core development requires Composer 1.9.0, but Composer /', $e->getMessage());
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.