bug #31430 Fix tests on master/4.3 (fabpot)
This PR was squashed before being merged into the 4.3-dev branch (closes #31430). Discussion ---------- Fix tests on master/4.3 | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | n/a | License | MIT | Doc PR | n/a <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Commits -------e6071a15c2
fixed test on Windows5b7a924c3d
fixed tests49ceb1e662
fixed a testaac59b167f
fixed tests
This commit is contained in:
commit
0462e1124c
@ -205,7 +205,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Po<TAB>Cr<TAB>P<DOWN ARROW><DOWN ARROW><NEWLINE>
|
// Po<TAB>Cr<TAB>P<DOWN ARROW><DOWN ARROW><NEWLINE>
|
||||||
$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();
|
$dialog = new QuestionHelper();
|
||||||
$helperSet = new HelperSet([new FormatterHelper()]);
|
$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
|
// No effort is made to avoid irrelevant suggestions, as this is handled
|
||||||
// by the autocomplete function.
|
// by the autocomplete function.
|
||||||
$callback = function ($input) {
|
$callback = function ($input) {
|
||||||
$knownWords = [
|
$knownWords = ['Carrot', 'Creme', 'Curry', 'Parsnip', 'Pie', 'Potato', 'Tart'];
|
||||||
'Carrot',
|
|
||||||
'Creme',
|
|
||||||
'Curry',
|
|
||||||
'Parsnip',
|
|
||||||
'Pie',
|
|
||||||
'Potato',
|
|
||||||
'Tart',
|
|
||||||
];
|
|
||||||
|
|
||||||
$inputWords = explode(' ', $input);
|
$inputWords = explode(' ', $input);
|
||||||
$lastInputWord = array_pop($inputWords);
|
array_pop($inputWords);
|
||||||
$suggestionBase = $inputWords
|
$suggestionBase = $inputWords ? implode(' ', $inputWords).' ' : '';
|
||||||
? implode(' ', $inputWords).' '
|
|
||||||
: '';
|
|
||||||
|
|
||||||
return array_map(
|
return array_map(
|
||||||
function ($word) use ($suggestionBase) {
|
function ($word) use ($suggestionBase) {
|
||||||
@ -249,14 +238,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
|||||||
|
|
||||||
$question->setAutocompleterCallback($callback);
|
$question->setAutocompleterCallback($callback);
|
||||||
|
|
||||||
$this->assertSame(
|
$this->assertSame('Potato Creme Pie', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
|
||||||
'Potato Creme Pie',
|
|
||||||
$dialog->ask(
|
|
||||||
$this->createStreamableInputInterfaceMock($inputStream),
|
|
||||||
$this->createOutputInterface(),
|
|
||||||
$question
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAskWithAutocompleteWithNonSequentialKeys()
|
public function testAskWithAutocompleteWithNonSequentialKeys()
|
||||||
@ -736,7 +718,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
|
|||||||
// F00<BACKSPACE><BACKSPACE>o<TAB>,A<DOWN ARROW>,<SPACE>SecurityBundle<NEWLINE>
|
// F00<BACKSPACE><BACKSPACE>o<TAB>,A<DOWN ARROW>,<SPACE>SecurityBundle<NEWLINE>
|
||||||
// Acme<TAB>,<SPACE>As<TAB><29x BACKSPACE>S<TAB><NEWLINE>
|
// Acme<TAB>,<SPACE>As<TAB><29x BACKSPACE>S<TAB><NEWLINE>
|
||||||
// Ac<TAB>,As<TAB><3x BACKSPACE>d<TAB><NEWLINE>
|
// Ac<TAB>,As<TAB><3x BACKSPACE>d<TAB><NEWLINE>
|
||||||
$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();
|
$dialog = new QuestionHelper();
|
||||||
$helperSet = new HelperSet([new FormatterHelper()]);
|
$helperSet = new HelperSet([new FormatterHelper()]);
|
||||||
|
@ -226,7 +226,7 @@ TXT
|
|||||||
{
|
{
|
||||||
$actualDuration = microtime(true) - $startTime;
|
$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');
|
$this->assertEqualsWithDelta($expectedDuration, $actualDuration, .5, 'Duration was not within expected range');
|
||||||
} else {
|
} else {
|
||||||
$this->assertEquals($expectedDuration, $actualDuration, 'Duration was not within expected range', .5);
|
$this->assertEquals($expectedDuration, $actualDuration, 'Duration was not within expected range', .5);
|
||||||
|
@ -70,7 +70,7 @@ EOF;
|
|||||||
|
|
||||||
$this->assertEquals($expectedCatalogue, $actualCatalogue);
|
$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.':2']], $catalogue->getMetadata('single-quoted key'));
|
||||||
$this->assertEquals(['sources' => [$filename.':43']], $catalogue->getMetadata('other-domain-test-no-params-short-array', 'not_messages'));
|
$this->assertEquals(['sources' => [$filename.':43']], $catalogue->getMetadata('other-domain-test-no-params-short-array', 'not_messages'));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user