mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-24 20:28:51 +00:00
[ticket/16639] Add two more asserts
PHPBB3-16639
This commit is contained in:
parent
65d8d4d6d3
commit
2d55977234
2 changed files with 5 additions and 3 deletions
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
require_once __DIR__ . '/local_test_case.php';
|
require_once __DIR__ . '/local_test_case.php';
|
||||||
|
|
||||||
class local_subfolders_test extends phpbb_local_test_case
|
class phpbb_storage_adapter_local_subfolders_test extends phpbb_local_test_case
|
||||||
{
|
{
|
||||||
protected function setUp(): void
|
protected function setUp(): void
|
||||||
{
|
{
|
||||||
|
@ -138,13 +138,14 @@ class local_subfolders_test extends phpbb_local_test_case
|
||||||
{
|
{
|
||||||
// Given
|
// Given
|
||||||
mkdir($this->path . '3d/8e', 0777, true);
|
mkdir($this->path . '3d/8e', 0777, true);
|
||||||
touch($this->path . '3d/8e/file.txt');
|
file_put_contents($this->path . '3d/8e/file.txt', 'abc');
|
||||||
|
|
||||||
// When
|
// When
|
||||||
$stream = $this->adapter->read_stream('file.txt');
|
$stream = $this->adapter->read_stream('file.txt');
|
||||||
|
|
||||||
// Then
|
// Then
|
||||||
$this->assertIsResource($stream);
|
$this->assertIsResource($stream);
|
||||||
|
$this->assertEquals('abc', stream_get_contents($stream));
|
||||||
|
|
||||||
// Clean test
|
// Clean test
|
||||||
fclose($stream);
|
fclose($stream);
|
||||||
|
|
|
@ -118,13 +118,14 @@ class phpbb_storage_adapter_local_test extends phpbb_local_test_case
|
||||||
public function test_read_stream()
|
public function test_read_stream()
|
||||||
{
|
{
|
||||||
// Given
|
// Given
|
||||||
touch($this->path . 'file.txt');
|
file_put_contents($this->path . 'file.txt', 'abc');
|
||||||
|
|
||||||
// When
|
// When
|
||||||
$stream = $this->adapter->read_stream('file.txt');
|
$stream = $this->adapter->read_stream('file.txt');
|
||||||
|
|
||||||
// Then
|
// Then
|
||||||
$this->assertIsResource($stream);
|
$this->assertIsResource($stream);
|
||||||
|
$this->assertEquals('abc', stream_get_contents($stream));
|
||||||
|
|
||||||
// Clean test
|
// Clean test
|
||||||
fclose($stream);
|
fclose($stream);
|
||||||
|
|
Loading…
Add table
Reference in a new issue