mirror of
https://codeberg.org/icewind/streams.git
synced 2026-06-03 08:34:09 +02:00
fixup tests
This commit is contained in:
parent
b8bea69ea6
commit
1c6d18170e
7 changed files with 25 additions and 20 deletions
30
tests/DirectoryTestWrapperTest.php
Normal file
30
tests/DirectoryTestWrapperTest.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
/**
|
||||
* Copyright (c) 2015 Robin Appelman <icewind@owncloud.com>
|
||||
* This file is licensed under the Licensed under the MIT license:
|
||||
* http://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
namespace Icewind\Streams\Tests;
|
||||
|
||||
class DirectoryTestWrapperTest extends IteratorDirectoryTest {
|
||||
|
||||
/**
|
||||
* @param \Iterator | array $source
|
||||
* @return resource
|
||||
*/
|
||||
protected function wrapSource($source) {
|
||||
$dir = \Icewind\Streams\IteratorDirectory::wrap($source);
|
||||
return DirectoryWrapperNull::wrap($dir);
|
||||
}
|
||||
|
||||
public function testManipulateContent() {
|
||||
$source = \Icewind\Streams\IteratorDirectory::wrap(['asd', 'bar']);
|
||||
$wrapped = DirectoryWrapperDummy::wrap($source);
|
||||
$result = [];
|
||||
while (($file = readdir($wrapped)) !== false) {
|
||||
$result[] = $file;
|
||||
}
|
||||
$this->assertEquals(['asd_', 'bar_'], $result);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue