function ExtensionInstallCommandTest::testInstallWithConfirmedDependency

Same name in this branch
  1. main core/tests/Drupal/KernelTests/Core/Extension/Command/ExtensionInstallCommandTest.php \Drupal\KernelTests\Core\Extension\Command\ExtensionInstallCommandTest::testInstallWithConfirmedDependency()
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::testInstallWithConfirmedDependency()
  2. 11.x core/tests/Drupal/KernelTests/Core/Extension/Command/ExtensionInstallCommandTest.php \Drupal\KernelTests\Core\Extension\Command\ExtensionInstallCommandTest::testInstallWithConfirmedDependency()

Tests confirming the prompt installs the module and its dependency.

File

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

Class

ExtensionInstallCommandTest
Tests the 'ex:install' command.

Namespace

Drupal\Tests\system\Kernel\Command

Code

public function testInstallWithConfirmedDependency() : void {
  $tester = $this->commandTester();
  $tester->setInputs([
    'yes',
  ]);
  $code = $tester->execute([
    'extensions' => 'console_test',
  ], [
    'interactive' => 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.