function ExtensionUninstallCommandTest::testYesOptionSkipsPrompt

Tests that --yes skips the confirmation prompt.

File

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

Class

ExtensionUninstallCommandTest
Tests the 'ex:uninstall' 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' => 'autowire_test',
    '--yes' => TRUE,
  ]);
  $this->assertEquals(Command::SUCCESS, $code, $tester->getDisplay());
  $this->assertFalse($this->moduleInstalled('autowire_test'));
  $this->assertFalse($this->moduleInstalled('console_test'));
}

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