MDL-78002 phpunit: Ensure that all uses of psr streams are closed
While the uses here were not causing too much problem with PHPUnit execution in any OS, better have them explicitly closed to better serve as reference for other, future uses anywhere in codebase. Always that a stream is used, better we close it as soon as possible, not relying on destructors, gc and friends.
This commit is contained in:
@@ -1093,6 +1093,7 @@ class file_system_test extends \advanced_testcase {
|
||||
$this->assertInstanceOf(\Psr\Http\Message\StreamInterface::class, $stream);
|
||||
$this->assertEquals(file_get_contents(__FILE__), $stream->getContents());
|
||||
$this->assertFalse($stream->isWritable());
|
||||
$stream->close();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -118,6 +118,7 @@ class stored_file_test extends advanced_testcase {
|
||||
$this->assertInstanceOf(\Psr\Http\Message\StreamInterface::class, $stream);
|
||||
$this->assertEquals(file_get_contents($filepath), $stream->getContents());
|
||||
$this->assertFalse($stream->isWritable());
|
||||
$stream->close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user