mirror of
https://github.com/phpbb/phpbb.git
synced 2025-04-05 00:13:29 +02:00
[ticket/15305] Add tests
PHPBB3-15305
This commit is contained in:
parent
dedd7648cd
commit
9b7a5fc2a5
@ -103,4 +103,23 @@
|
||||
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');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user