function ExtensionInstallCommandTest::testNonInteractiveAbortsWithoutYes

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

Tests that a non-interactive run aborts unless --yes is supplied.

File

core/tests/Drupal/KernelTests/Core/Extension/Command/ExtensionInstallCommandTest.php, line 123

Class

ExtensionInstallCommandTest
Tests the 'ex:install' command.

Namespace

Drupal\KernelTests\Core\Extension\Command

Code

public function testNonInteractiveAbortsWithoutYes() : void {
  // Dependencies must be confirmed with --yes when there is no interactive
  // prompt to answer; the command aborts before installing anything.
  $this->expectException(UserAbortException::class);
  $this->commandTester()
    ->execute([
    'extensions' => 'console_test',
  ], [
    'interactive' => FALSE,
  ]);
}

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