Skip to content

Commit 44f8828

Browse files
committed
minor #51299 [PsrHttpMessageBridge] Fix test case (nicolas-grekas)
This PR was merged into the 6.4 branch. Discussion ---------- [PsrHttpMessageBridge] Fix test case | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - On Windows, this test case fails with: ``` 1) Symfony\Bridge\PsrHttpMessage\Tests\Factory\PsrHttpFactoryTest::testUploadErrNoFile RuntimeException: The file "C:\projects\symfony" cannot be opened: fopen(C:\projects\symfony): Failed to open stream: Permission denied ``` The reason is that the empty string is turned into the empty directory, and you can't fopen a directory on Windows. The removed assertion have no purpose, they only check the behavior of the native SplFileInfo class. Commits ------- 9edd7b9788 [PsrHttpMessageBridge] Fix test case
2 parents e936c0b + a49cf0a commit 44f8828

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Tests/Factory/PsrHttpFactoryTest.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,7 @@ public function testCreateResponseFromBinaryFileWithRange()
211211

212212
public function testUploadErrNoFile()
213213
{
214-
$file = new UploadedFile('', '', null, \UPLOAD_ERR_NO_FILE, true);
215-
216-
$this->assertSame(\UPLOAD_ERR_NO_FILE, $file->getError());
217-
$this->assertFalse($file->getSize(), 'SplFile::getSize() returns false on error');
214+
$file = new UploadedFile(__FILE__, '', null, \UPLOAD_ERR_NO_FILE, true);
218215

219216
$request = new Request(
220217
[],

0 commit comments

Comments
 (0)