[6.x] Fix Filesystem tests failing in Windows #32975
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should be the last of it. All tests are now green in Windows.
FilesystemAdapterTest::testPutWithStreamInterface()
#30179 comments noted that
Storage::put()
implementation could leave a stream open by the PHP script. This has caused a chain of filesystem tests to fail in Windows becauseFilesystemAdapterTest::tearDown()
can't delete the temp directory when a "foo.txt" temp file has an activefopen()
stream.GuzzleHttp\Psr7\Stream::__destruct()
is meant to gracefullyfclose($this->stream)
throughGuzzleHttp\Psr7\Stream::__close()
GuzzleHttp\Psr7\Stream::detach()
to fetch stream content, theclose()
method now hits$this->stream === null
so it's on userland to explicitly callfclose()
.FilesystemTest::testReplaceStoresFiles()
#26254 added a test that only works in Linux/macOS. The
chmod()
/umask()
write-permission changes have no effect on Windows andsymlink()
fails unless:"{$this->tempDir}/file.txt"
already exists.So I've skipped adding the below Windows-only test as a counterpart to
testReplaceWhenUnixSymlinkExists
.