mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 19:48:49 +02:00
Updating Symfony lib and dependencies:
Package operations: 2 installs, 23 updates, 0 removals - Updating psr/log (1.1.0 => 1.1.2) - Updating symfony/debug (v3.4.30 => v3.4.35) - Updating symfony/console (v3.4.30 => v3.4.35) - Updating symfony/dotenv (v3.4.30 => v3.4.35) - Updating symfony/routing (v3.4.30 => v3.4.35) - Updating symfony/finder (v3.4.30 => v3.4.35) - Updating symfony/filesystem (v3.4.30 => v3.4.35) - Installing symfony/polyfill-util (v1.12.0) - Installing symfony/polyfill-php56 (v1.12.0) - Updating symfony/http-foundation (v3.4.30 => v3.4.35) - Updating symfony/event-dispatcher (v3.4.30 => v3.4.35) - Updating symfony/http-kernel (v3.4.30 => v3.4.35) - Updating symfony/config (v3.4.30 => v3.4.35) - Updating symfony/dependency-injection (v3.4.30 => v3.4.35) - Updating symfony/class-loader (v3.4.30 => v3.4.35) - Updating symfony/cache (v3.4.30 => v3.4.35) - Updating symfony/framework-bundle (v3.4.30 => v3.4.35) - Updating twig/twig (v1.42.2 => v1.42.4) - Updating symfony/twig-bridge (v3.4.30 => v3.4.35) - Updating symfony/twig-bundle (v3.4.30 => v3.4.35) - Updating symfony/yaml (v3.4.30 => v3.4.35) - Updating symfony/stopwatch (v3.4.30 => v3.4.35) - Updating symfony/var-dumper (v3.4.30 => v3.4.35) - Updating symfony/web-profiler-bundle (v3.4.30 => v3.4.35) - Updating symfony/css-selector (v3.4.30 => v3.4.35)
This commit is contained in:
@@ -19,6 +19,7 @@ use Symfony\Component\Console\Output\StreamOutput;
|
||||
use Symfony\Component\Console\Question\ChoiceQuestion;
|
||||
use Symfony\Component\Console\Question\ConfirmationQuestion;
|
||||
use Symfony\Component\Console\Question\Question;
|
||||
use Symfony\Component\Console\Terminal;
|
||||
|
||||
/**
|
||||
* @group tty
|
||||
@@ -53,7 +54,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
||||
|
||||
rewind($output->getStream());
|
||||
$stream = stream_get_contents($output->getStream());
|
||||
$this->assertContains('Input "Fabien" is not a superhero!', $stream);
|
||||
$this->assertStringContainsString('Input "Fabien" is not a superhero!', $stream);
|
||||
|
||||
try {
|
||||
$question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '1');
|
||||
@@ -167,7 +168,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
||||
|
||||
public function testAskWithAutocomplete()
|
||||
{
|
||||
if (!$this->hasSttyAvailable()) {
|
||||
if (!Terminal::hasSttyAvailable()) {
|
||||
$this->markTestSkipped('`stty` is required to test autocomplete functionality');
|
||||
}
|
||||
|
||||
@@ -200,7 +201,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
||||
|
||||
public function testAskWithAutocompleteWithNonSequentialKeys()
|
||||
{
|
||||
if (!$this->hasSttyAvailable()) {
|
||||
if (!Terminal::hasSttyAvailable()) {
|
||||
$this->markTestSkipped('`stty` is required to test autocomplete functionality');
|
||||
}
|
||||
|
||||
@@ -219,7 +220,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
||||
|
||||
public function testAskWithAutocompleteWithExactMatch()
|
||||
{
|
||||
if (!$this->hasSttyAvailable()) {
|
||||
if (!Terminal::hasSttyAvailable()) {
|
||||
$this->markTestSkipped('`stty` is required to test autocomplete functionality');
|
||||
}
|
||||
|
||||
@@ -255,7 +256,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
||||
*/
|
||||
public function testAskWithAutocompleteWithMultiByteCharacter($character)
|
||||
{
|
||||
if (!$this->hasSttyAvailable()) {
|
||||
if (!Terminal::hasSttyAvailable()) {
|
||||
$this->markTestSkipped('`stty` is required to test autocomplete functionality');
|
||||
}
|
||||
|
||||
@@ -279,7 +280,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
||||
|
||||
public function testAutocompleteWithTrailingBackslash()
|
||||
{
|
||||
if (!$this->hasSttyAvailable()) {
|
||||
if (!Terminal::hasSttyAvailable()) {
|
||||
$this->markTestSkipped('`stty` is required to test autocomplete functionality');
|
||||
}
|
||||
|
||||
@@ -518,12 +519,10 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
||||
$this->assertSame($expectedValue, $answer);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage The provided answer is ambiguous. Value should be one of env_2 or env_3.
|
||||
*/
|
||||
public function testAmbiguousChoiceFromChoicelist()
|
||||
{
|
||||
$this->expectException('InvalidArgumentException');
|
||||
$this->expectExceptionMessage('The provided answer is ambiguous. Value should be one of env_2 or env_3.');
|
||||
$possibleChoices = [
|
||||
'env_1' => 'My first environment',
|
||||
'env_2' => 'My environment',
|
||||
@@ -618,7 +617,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
||||
|
||||
rewind($output->getStream());
|
||||
$stream = stream_get_contents($output->getStream());
|
||||
$this->assertContains('Input "Fabien" is not a superhero!', $stream);
|
||||
$this->assertStringContainsString('Input "Fabien" is not a superhero!', $stream);
|
||||
|
||||
try {
|
||||
$question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '1');
|
||||
@@ -674,7 +673,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
||||
*/
|
||||
public function testLegacyAskWithAutocomplete()
|
||||
{
|
||||
if (!$this->hasSttyAvailable()) {
|
||||
if (!Terminal::hasSttyAvailable()) {
|
||||
$this->markTestSkipped('`stty` is required to test autocomplete functionality');
|
||||
}
|
||||
|
||||
@@ -711,7 +710,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
||||
*/
|
||||
public function testLegacyAskWithAutocompleteWithNonSequentialKeys()
|
||||
{
|
||||
if (!$this->hasSttyAvailable()) {
|
||||
if (!Terminal::hasSttyAvailable()) {
|
||||
$this->markTestSkipped('`stty` is required to test autocomplete functionality');
|
||||
}
|
||||
|
||||
@@ -748,7 +747,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @group legacy
|
||||
* @dataProvider getAskConfirmationData
|
||||
*/
|
||||
public function testLegacyAskConfirmation($question, $expected, $default = true)
|
||||
@@ -810,7 +809,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @group legacy
|
||||
* @dataProvider simpleAnswerProvider
|
||||
*/
|
||||
public function testLegacySelectChoiceFromSimpleChoices($providedAnswer, $expectedValue)
|
||||
@@ -834,7 +833,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @group legacy
|
||||
* @dataProvider mixedKeysChoiceListAnswerProvider
|
||||
*/
|
||||
public function testLegacyChoiceFromChoicelistWithMixedKeys($providedAnswer, $expectedValue)
|
||||
@@ -859,7 +858,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @group legacy
|
||||
* @dataProvider answerProvider
|
||||
*/
|
||||
public function testLegacySelectChoiceFromChoiceList($providedAnswer, $expectedValue)
|
||||
@@ -883,12 +882,12 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage The provided answer is ambiguous. Value should be one of env_2 or env_3.
|
||||
* @group legacy
|
||||
*/
|
||||
public function testLegacyAmbiguousChoiceFromChoicelist()
|
||||
{
|
||||
$this->expectException('InvalidArgumentException');
|
||||
$this->expectExceptionMessage('The provided answer is ambiguous. Value should be one of env_2 or env_3.');
|
||||
$possibleChoices = [
|
||||
'env_1' => 'My first environment',
|
||||
'env_2' => 'My environment',
|
||||
@@ -938,36 +937,30 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
||||
$dialog->ask($this->createInputInterfaceMock(), $output, $question);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\Console\Exception\RuntimeException
|
||||
* @expectedExceptionMessage Aborted.
|
||||
*/
|
||||
public function testAskThrowsExceptionOnMissingInput()
|
||||
{
|
||||
$this->expectException('Symfony\Component\Console\Exception\RuntimeException');
|
||||
$this->expectExceptionMessage('Aborted.');
|
||||
$dialog = new QuestionHelper();
|
||||
$dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream('')), $this->createOutputInterface(), new Question('What\'s your name?'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\Console\Exception\RuntimeException
|
||||
* @expectedExceptionMessage Aborted.
|
||||
*/
|
||||
public function testAskThrowsExceptionOnMissingInputForChoiceQuestion()
|
||||
{
|
||||
$this->expectException('Symfony\Component\Console\Exception\RuntimeException');
|
||||
$this->expectExceptionMessage('Aborted.');
|
||||
$dialog = new QuestionHelper();
|
||||
$dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream('')), $this->createOutputInterface(), new ChoiceQuestion('Choice', ['a', 'b']));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\Console\Exception\RuntimeException
|
||||
* @expectedExceptionMessage Aborted.
|
||||
*/
|
||||
public function testAskThrowsExceptionOnMissingInputWithValidator()
|
||||
{
|
||||
$this->expectException('Symfony\Component\Console\Exception\RuntimeException');
|
||||
$this->expectExceptionMessage('Aborted.');
|
||||
$dialog = new QuestionHelper();
|
||||
|
||||
$question = new Question('What\'s your name?');
|
||||
$question->setValidator(function () {
|
||||
$question->setValidator(function ($value) {
|
||||
if (!$value) {
|
||||
throw new \Exception('A value is required.');
|
||||
}
|
||||
@@ -976,18 +969,16 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
||||
$dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream('')), $this->createOutputInterface(), $question);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \LogicException
|
||||
* @expectedExceptionMessage Choice question must have at least 1 choice available.
|
||||
*/
|
||||
public function testEmptyChoices()
|
||||
{
|
||||
$this->expectException('LogicException');
|
||||
$this->expectExceptionMessage('Choice question must have at least 1 choice available.');
|
||||
new ChoiceQuestion('Question', [], 'irrelevant');
|
||||
}
|
||||
|
||||
public function testTraversableAutocomplete()
|
||||
{
|
||||
if (!$this->hasSttyAvailable()) {
|
||||
if (!Terminal::hasSttyAvailable()) {
|
||||
$this->markTestSkipped('`stty` is required to test autocomplete functionality');
|
||||
}
|
||||
|
||||
@@ -1072,13 +1063,6 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
||||
|
||||
return $mock;
|
||||
}
|
||||
|
||||
private function hasSttyAvailable()
|
||||
{
|
||||
exec('stty 2>&1', $output, $exitcode);
|
||||
|
||||
return 0 === $exitcode;
|
||||
}
|
||||
}
|
||||
|
||||
class AutocompleteValues implements \IteratorAggregate
|
||||
|
||||
Reference in New Issue
Block a user