function ExtensionInstallCommandTest::testYesOptionSkipsPrompt

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

Tests that --yes skips the confirmation prompt.

File

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

Class

ExtensionInstallCommandTest
Tests the 'ex:install' command.

Namespace

Drupal\KernelTests\Core\Extension\Command

Code

public function testYesOptionSkipsPrompt() : void {
  $tester = $this->commandTester();
  // No inputs are provided; with --yes the prompt must not be reached.
  $code = $tester->execute([
    'extensions' => 'console_test',
    '--yes' => TRUE,
  ]);
  $this->assertEquals(Command::SUCCESS, $code);
  $this->assertTrue($this->moduleInstalled('console_test'));
  $this->assertTrue($this->moduleInstalled('autowire_test'));
}

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