Skip to content

Commit 3c30754

Browse files
committed
Merge branch '4.4' into 5.2
* 4.4: skip intl dependent tests if the extension is missing make DateCaster tests timezone-agnostic error if the input string couldn't be parsed as a date IntegerType: Always use en for IntegerToLocalizedStringTransformer Fixes #40456 Uses the correct assignment action for console options depending if they are short or long [HttpKernel] ConfigDataCollector to return known data without the need of a Kernel [HttpClient] fix using stream_copy_to_stream() with responses cast to php streams FIx Trying to clone an uncloneable object of class
2 parents 2b9f0d4 + 911177e commit 3c30754

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Response/StreamWrapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ public function stream_stat(): array
289289
'uid' => 0,
290290
'gid' => 0,
291291
'rdev' => 0,
292-
'size' => (int) ($headers['content-length'][0] ?? 0),
292+
'size' => (int) ($headers['content-length'][0] ?? -1),
293293
'atime' => 0,
294294
'mtime' => strtotime($headers['last-modified'][0] ?? '') ?: 0,
295295
'ctime' => 0,

Tests/HttpClientTestCase.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,19 @@ public function testToStream()
7575
$this->assertTrue(feof($stream));
7676
}
7777

78+
public function testStreamCopyToStream()
79+
{
80+
$client = $this->getHttpClient(__FUNCTION__);
81+
$response = $client->request('GET', 'http://localhost:8057');
82+
$h = fopen('php://temp', 'w+');
83+
stream_copy_to_stream($response->toStream(), $h);
84+
85+
$this->assertTrue(rewind($h));
86+
$this->assertSame("{\n \"SER", fread($h, 10));
87+
$this->assertSame('VER_PROTOCOL', fread($h, 12));
88+
$this->assertFalse(feof($h));
89+
}
90+
7891
public function testToStream404()
7992
{
8093
$client = $this->getHttpClient(__FUNCTION__);

0 commit comments

Comments
 (0)