function InputTest::testAskHiddenPromptArgumentsForwarded

Tests that the askHidden prompt forwards arguments correctly.

File

core/tests/Drupal/KernelTests/Core/Recipe/InputTest.php, line 297

Class

InputTest
@group Recipe @covers \Drupal\Core\Recipe\InputConfigurator

Namespace

Drupal\KernelTests\Core\Recipe

Code

public function testAskHiddenPromptArgumentsForwarded() : void {
    $input = $this->createMock(InputInterface::class);
    $output = $this->createMock(OutputInterface::class);
    $io = new SymfonyStyle($input, $output);
    $recipe = $this->createRecipe(<<<YAML
name: 'Prompt askHidden Test'
input:
  foo:
    data_type: string
    description: Foo
    prompt:
      method: askHidden
    default:
      source: value
      value: bar
YAML
);
    $collector = new ConsoleInputCollector($input, $io);
    // askHidden prompt should have an ArgumentCountError rather than a general
    // error.
    $this->expectException(\ArgumentCountError::class);
    $recipe->input
        ->collectAll($collector);
}

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