mirror of
https://codeberg.org/icewind/streams.git
synced 2026-06-03 16:44:07 +02:00
Better cleanup of registered streams
This commit is contained in:
parent
214a31bc98
commit
99ecfc5287
4 changed files with 26 additions and 7 deletions
|
|
@ -21,8 +21,8 @@ class IteratorDirectory extends \PHPUnit_Framework_TestCase {
|
|||
* @expectedException \BadMethodCallException
|
||||
*/
|
||||
public function testNoContext() {
|
||||
stream_wrapper_register('iterator', '\Icewind\Streams\IteratorDirectory');
|
||||
$context = stream_context_create(array());
|
||||
stream_wrapper_register('iterator', '\Icewind\Streams\IteratorDirectory');
|
||||
try {
|
||||
opendir('iterator://', $context);
|
||||
stream_wrapper_unregister('iterator');
|
||||
|
|
@ -36,12 +36,12 @@ class IteratorDirectory extends \PHPUnit_Framework_TestCase {
|
|||
* @expectedException \BadMethodCallException
|
||||
*/
|
||||
public function testInvalidSource() {
|
||||
stream_wrapper_register('iterator', '\Icewind\Streams\IteratorDirectory');
|
||||
$context = stream_context_create(array(
|
||||
'dir' => array(
|
||||
'array' => 2
|
||||
)
|
||||
));
|
||||
stream_wrapper_register('iterator', '\Icewind\Streams\IteratorDirectory');
|
||||
try {
|
||||
opendir('iterator://', $context);
|
||||
stream_wrapper_unregister('iterator');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue