mirror of
https://codeberg.org/icewind/streams.git
synced 2026-06-03 16:44:07 +02:00
fixup tests
This commit is contained in:
parent
b8bea69ea6
commit
1c6d18170e
7 changed files with 25 additions and 20 deletions
39
tests/RetryWrapperTest.php
Normal file
39
tests/RetryWrapperTest.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
/**
|
||||
* Copyright (c) 2014 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 RetryWrapperTest extends WrapperTest {
|
||||
|
||||
/**
|
||||
* @param resource $source
|
||||
* @return resource
|
||||
*/
|
||||
protected function wrapSource($source) {
|
||||
return \Icewind\Streams\RetryWrapper::wrap(PartialWrapper::wrap($source));
|
||||
}
|
||||
|
||||
public function testReadDir() {
|
||||
$this->markTestSkipped('directories not supported');
|
||||
}
|
||||
|
||||
public function testRewindDir() {
|
||||
$this->markTestSkipped('directories not supported');
|
||||
}
|
||||
|
||||
public function testFailedRead() {
|
||||
$source = fopen('data://text/plain,foo', 'r');
|
||||
$wrapped = \Icewind\Streams\RetryWrapper::wrap(FailWrapper::wrap($source));
|
||||
$this->assertEquals('', fread($wrapped, 10));
|
||||
}
|
||||
|
||||
public function testFailedWrite() {
|
||||
$source = fopen('php://temp', 'w');
|
||||
$wrapped = \Icewind\Streams\RetryWrapper::wrap(FailWrapper::wrap($source));
|
||||
$this->assertFalse(fwrite($wrapped, 'foo'));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue