Skip to content

Commit

Permalink
Avoid supplied resource is not a valid stream
Browse files Browse the repository at this point in the history
  • Loading branch information
erikn69 committed Dec 27, 2021
1 parent 4b6da3e commit a5cb83b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/quality-assurance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php: [ '7.2', '7.3', '7.4' ]
composer-flags: [ '' ]
Expand Down
8 changes: 6 additions & 2 deletions src/AdapterTestUtilities/FilesystemAdapterTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ public function writing_a_file_with_a_stream(): void
$writeStream = stream_with_contents('contents');

$adapter->writeStream('path.txt', $writeStream, new Config());
fclose($writeStream);
if (is_resource($writeStream)) {
fclose($writeStream);
}
$fileExists = $adapter->fileExists('path.txt');

$this->assertTrue($fileExists);
Expand Down Expand Up @@ -195,7 +197,9 @@ public function writing_a_file_with_an_empty_stream(): void
$writeStream = stream_with_contents('');

$adapter->writeStream('path.txt', $writeStream, new Config());
fclose($writeStream);
if (is_resource($writeStream)) {
fclose($writeStream);
}
$fileExists = $adapter->fileExists('path.txt');

$this->assertTrue($fileExists);
Expand Down

0 comments on commit a5cb83b

Please sign in to comment.