mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-01 22:40:39 +02:00
[ticket/15305] Add tests
PHPBB3-15305
This commit is contained in:
@@ -103,4 +103,23 @@
|
|||||||
unlink($this->path . 'file2.txt');
|
unlink($this->path . 'file2.txt');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_read_stream()
|
||||||
|
{
|
||||||
|
file_put_contents($this->path . 'file.txt', '');
|
||||||
|
$stream = $this->adapter->read_stream($this->path . 'file.txt');
|
||||||
|
$this->assertTrue(is_resource($stream));
|
||||||
|
fclose($stream);
|
||||||
|
unlink($this->path . 'file.txt');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test_write_stream()
|
||||||
|
{
|
||||||
|
file_put_contents($this->path . 'file.txt', 'abc');
|
||||||
|
$stream = fopen($this->path . 'file.txt', 'r');
|
||||||
|
$this->adapter->write_stream($this->path . 'file2.txt', $stream);
|
||||||
|
fclose($stream);
|
||||||
|
$this->assertEquals(file_get_contents($this->path . 'file2.txt'), 'abc');
|
||||||
|
unlink($this->path . 'file.txt');
|
||||||
|
unlink($this->path . 'file2.txt');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user