[Console] Fix SymfonyQuestionHelper tests sometimes failing on AppVeyor
This commit is contained in:
parent
416f0abf99
commit
474f3bef08
@ -145,13 +145,13 @@ class SymfonyQuestionHelperTest extends AbstractQuestionHelperTest
|
|||||||
);
|
);
|
||||||
|
|
||||||
$this->assertOutputContains(<<<EOT
|
$this->assertOutputContains(<<<EOT
|
||||||
qqq:
|
qqq:
|
||||||
[foo ] foo
|
[foo ] foo
|
||||||
[żółw ] bar
|
[żółw ] bar
|
||||||
[łabądź] baz
|
[łabądź] baz
|
||||||
>
|
>
|
||||||
EOT
|
EOT
|
||||||
, $output);
|
, $output, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testChoiceQuestionCustomPrompt()
|
public function testChoiceQuestionCustomPrompt()
|
||||||
@ -170,7 +170,7 @@ EOT
|
|||||||
[0] foo
|
[0] foo
|
||||||
>ccc>
|
>ccc>
|
||||||
EOT
|
EOT
|
||||||
, $output);
|
, $output, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getInputStream($input)
|
protected function getInputStream($input)
|
||||||
@ -200,10 +200,15 @@ EOT
|
|||||||
return $mock;
|
return $mock;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function assertOutputContains($expected, StreamOutput $output)
|
private function assertOutputContains($expected, StreamOutput $output, $normalize = false)
|
||||||
{
|
{
|
||||||
rewind($output->getStream());
|
rewind($output->getStream());
|
||||||
$stream = stream_get_contents($output->getStream());
|
$stream = stream_get_contents($output->getStream());
|
||||||
|
|
||||||
|
if ($normalize) {
|
||||||
|
$stream = str_replace(PHP_EOL, "\n", $stream);
|
||||||
|
}
|
||||||
|
|
||||||
$this->assertStringContainsString($expected, $stream);
|
$this->assertStringContainsString($expected, $stream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user