streams/tests/RetryWrapperTest.php
Andy Scherzinger d95aa6fa7e
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-06-02 20:52:50 +02:00

38 lines
991 B
PHP

<?php
/**
* SPDX-FileCopyrightText: 2014 Robin Appelman <icewind@owncloud.com>
* SPDX-License-Identifier: 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((bool)fwrite($wrapped, 'foo'));
}
}