composer update

This commit is contained in:
Oliver Davies 2019-01-24 08:00:03 +00:00
parent f6abc3dce2
commit 71dfaca858
1753 changed files with 45274 additions and 14619 deletions

View file

@ -776,6 +776,20 @@ class ApplicationTest extends TestCase
$this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_linebreaks.txt', $tester->getDisplay(true), '->renderException() keep multiple line breaks');
}
public function testRenderExceptionStackTraceContainsRootException()
{
$application = new Application();
$application->setAutoExit(false);
$application->register('foo')->setCode(function () {
throw new \Exception('Verbose exception');
});
$tester = new ApplicationTester($application);
$tester->run(array('command' => 'foo'), array('decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE));
$this->assertContains(sprintf('() at %s:', __FILE__), $tester->getDisplay());
}
public function testRun()
{
$application = new Application();
@ -905,7 +919,7 @@ class ApplicationTest extends TestCase
$application->setAutoExit(false);
$application->expects($this->once())
->method('doRun')
->will($this->throwException($exception));
->willThrowException($exception);
$exitCode = $application->run(new ArrayInput(array()), new NullOutput());
@ -944,7 +958,7 @@ class ApplicationTest extends TestCase
$application->setAutoExit(false);
$application->expects($this->once())
->method('doRun')
->will($this->throwException($exception));
->willThrowException($exception);
$exitCode = $application->run(new ArrayInput(array()), new NullOutput());

View file

@ -166,6 +166,14 @@ class CommandTest extends TestCase
$command = new \TestCommand();
$command->setHelp('');
$this->assertContains('description', $command->getProcessedHelp(), '->getProcessedHelp() falls back to the description');
$command = new \TestCommand();
$command->setHelp('The %command.name% command does... Example: php %command.full_name%.');
$application = new Application();
$application->add($command);
$application->setDefaultCommand('namespace:name', true);
$this->assertContains('The namespace:name command does...', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.name% correctly in single command applications');
$this->assertNotContains('%command.full_name%', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.full_name% in single command applications');
}
public function testGetSetAliases()

View file

@ -112,6 +112,31 @@ class CommandTesterTest extends TestCase
$this->assertEquals(implode('', $questions), $tester->getDisplay(true));
}
public function testCommandWithDefaultInputs()
{
$questions = array(
'What\'s your name?',
'How are you?',
'Where do you come from?',
);
$command = new Command('foo');
$command->setHelperSet(new HelperSet(array(new QuestionHelper())));
$command->setCode(function ($input, $output) use ($questions, $command) {
$helper = $command->getHelper('question');
$helper->ask($input, $output, new Question($questions[0], 'Bobby'));
$helper->ask($input, $output, new Question($questions[1], 'Fine'));
$helper->ask($input, $output, new Question($questions[2], 'France'));
});
$tester = new CommandTester($command);
$tester->setInputs(array('', '', ''));
$tester->execute(array());
$this->assertEquals(0, $tester->getStatusCode());
$this->assertEquals(implode('', $questions), $tester->getDisplay(true));
}
/**
* @expectedException \RuntimeException
* @expectedMessage Aborted