function ExtensionInstallCommandTest::testUnknownExtensionFails

Same name in this branch
  1. 11.x core/tests/Drupal/KernelTests/Core/Extension/Command/ExtensionInstallCommandTest.php \Drupal\KernelTests\Core\Extension\Command\ExtensionInstallCommandTest::testUnknownExtensionFails()
Same name and namespace in other branches
  1. main core/modules/system/tests/src/Kernel/Command/ExtensionInstallCommandTest.php \Drupal\Tests\system\Kernel\Command\ExtensionInstallCommandTest::testUnknownExtensionFails()
  2. main core/tests/Drupal/KernelTests/Core/Extension/Command/ExtensionInstallCommandTest.php \Drupal\KernelTests\Core\Extension\Command\ExtensionInstallCommandTest::testUnknownExtensionFails()

Tests that an unknown extension produces an error.

File

core/modules/system/tests/src/Kernel/Command/ExtensionInstallCommandTest.php, line 158

Class

ExtensionInstallCommandTest
Tests the 'ex:install' command.

Namespace

Drupal\Tests\system\Kernel\Command

Code

public function testUnknownExtensionFails() : void {
  $tester = $this->commandTester();
  $code = $tester->execute([
    'extensions' => 'this_does_not_exist',
  ]);
  $this->assertEquals(Command::FAILURE, $code);
  $this->assertStringContainsString('could not be found', $tester->getDisplay());
}

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