diff --git a/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php b/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php index c97c0e849f..e02d905014 100644 --- a/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php @@ -205,7 +205,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest } // PoCrP - $inputStream = $this->getInputStream("Pa\177\177o\tCr\t\033[A\033[A\033[A\n"); + $inputStream = $this->getInputStream("Pa\177\177o\tCr\tP\033[A\033[A\n"); $dialog = new QuestionHelper(); $helperSet = new HelperSet([new FormatterHelper()]); @@ -223,21 +223,10 @@ class QuestionHelperTest extends AbstractQuestionHelperTest // No effort is made to avoid irrelevant suggestions, as this is handled // by the autocomplete function. $callback = function ($input) { - $knownWords = [ - 'Carrot', - 'Creme', - 'Curry', - 'Parsnip', - 'Pie', - 'Potato', - 'Tart', - ]; - + $knownWords = ['Carrot', 'Creme', 'Curry', 'Parsnip', 'Pie', 'Potato', 'Tart']; $inputWords = explode(' ', $input); - $lastInputWord = array_pop($inputWords); - $suggestionBase = $inputWords - ? implode(' ', $inputWords).' ' - : ''; + array_pop($inputWords); + $suggestionBase = $inputWords ? implode(' ', $inputWords).' ' : ''; return array_map( function ($word) use ($suggestionBase) { @@ -249,14 +238,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest $question->setAutocompleterCallback($callback); - $this->assertSame( - 'Potato Creme Pie', - $dialog->ask( - $this->createStreamableInputInterfaceMock($inputStream), - $this->createOutputInterface(), - $question - ) - ); + $this->assertSame('Potato Creme Pie', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question)); } public function testAskWithAutocompleteWithNonSequentialKeys() @@ -736,7 +718,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest // F00o,A,SecurityBundle // Acme,As<29x BACKSPACE>S // Ac,As<3x BACKSPACE>d - $inputStream = $this->getInputStream("\nF\t\nA\033[A\033[A\033[A\t,F\t\nF00\177\177o\t,A\033[B\t, SecurityBundle\nAcme\t, As\t\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177S\t\nAc\t,As\t\177\177\177d\t\n"); + $inputStream = $this->getInputStream("\nF\t\nA\033[A\033[A\033[A\t,F\t\nF00\177\177o\t,A\033[B\t, SecurityBundle\nSecurityBundle\nAcme\t, As\t\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177S\t\nAc\t,As\t\177\177\177d\t\n"); $dialog = new QuestionHelper(); $helperSet = new HelperSet([new FormatterHelper()]); diff --git a/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/AmqpExtIntegrationTest.php b/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/AmqpExtIntegrationTest.php index 9c8b18e990..956e09dc31 100644 --- a/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/AmqpExtIntegrationTest.php +++ b/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/AmqpExtIntegrationTest.php @@ -226,7 +226,7 @@ TXT { $actualDuration = microtime(true) - $startTime; - if (\method_exists([$this, 'assertEqualsWithDelta'])) { + if (method_exists($this, 'assertEqualsWithDelta')) { $this->assertEqualsWithDelta($expectedDuration, $actualDuration, .5, 'Duration was not within expected range'); } else { $this->assertEquals($expectedDuration, $actualDuration, 'Duration was not within expected range', .5); diff --git a/src/Symfony/Component/Translation/Tests/Extractor/PhpExtractorTest.php b/src/Symfony/Component/Translation/Tests/Extractor/PhpExtractorTest.php index 957d9df290..a6d7c5001c 100644 --- a/src/Symfony/Component/Translation/Tests/Extractor/PhpExtractorTest.php +++ b/src/Symfony/Component/Translation/Tests/Extractor/PhpExtractorTest.php @@ -70,7 +70,7 @@ EOF; $this->assertEquals($expectedCatalogue, $actualCatalogue); - $filename = __DIR__.'/../fixtures/extractor/translation.html.php'; + $filename = str_replace(\DIRECTORY_SEPARATOR, '/', __DIR__).'/../fixtures/extractor/translation.html.php'; $this->assertEquals(['sources' => [$filename.':2']], $catalogue->getMetadata('single-quoted key')); $this->assertEquals(['sources' => [$filename.':43']], $catalogue->getMetadata('other-domain-test-no-params-short-array', 'not_messages')); }