Skip to content

Commit 10bb3ee

Browse files
Merge branch '3.4' into 4.4
* 3.4: Fix versions [Security/Http] Allow setting cookie security settings for delete_cookies [FrameworkBundle] revert to legacy wiring of the session when circular refs are detected bumped Symfony version to 3.4.40 updated VERSION for 3.4.39 update CONTRIBUTORS for 3.4.39 updated CHANGELOG for 3.4.39 update Italian translation [Validator] Add missing Hungarian translations [Validator] Add the missing translations for the Arabic (ar) locale [Validator] Add missing vietnamese translations [Console] Fix OutputStream for PHP 7.4 add German translations bug #36157 [Validator] Assert Valid with many groups [Validator] Add missing Lithuanian translations Fixed some typos Add french "at least" constraint translations
2 parents 909f97f + bf60d5e commit 10bb3ee

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

Output/StreamOutput.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Console\Output;
1313

1414
use Symfony\Component\Console\Exception\InvalidArgumentException;
15-
use Symfony\Component\Console\Exception\RuntimeException;
1615
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
1716

1817
/**
@@ -74,10 +73,7 @@ protected function doWrite($message, $newline)
7473
$message .= PHP_EOL;
7574
}
7675

77-
if (false === @fwrite($this->stream, $message)) {
78-
// should never happen
79-
throw new RuntimeException('Unable to write output.');
80-
}
76+
@fwrite($this->stream, $message);
8177

8278
fflush($this->stream);
8379
}

Tests/Fixtures/stream_output_file.txt

Whitespace-only changes.

Tests/Output/StreamOutputTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,12 @@ public function testDoWrite()
5656
rewind($output->getStream());
5757
$this->assertEquals('foo'.PHP_EOL, stream_get_contents($output->getStream()), '->doWrite() writes to the stream');
5858
}
59+
60+
public function testDoWriteOnFailure()
61+
{
62+
$resource = fopen(__DIR__.'/../Fixtures/stream_output_file.txt', 'r', false);
63+
$output = new StreamOutput($resource);
64+
rewind($output->getStream());
65+
$this->assertEquals('', stream_get_contents($output->getStream()));
66+
}
5967
}

0 commit comments

Comments
 (0)