mirror of
https://codeberg.org/icewind/streams.git
synced 2026-06-03 08:34:09 +02:00
fixup tests
This commit is contained in:
parent
b8bea69ea6
commit
1c6d18170e
7 changed files with 25 additions and 20 deletions
26
tests/PathWrapperTest.php
Normal file
26
tests/PathWrapperTest.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
/**
|
||||
* Copyright (c) 2016 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;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class PathWrapperTest extends TestCase {
|
||||
private function getDataStream($data) {
|
||||
$stream = fopen('php://temp', 'w+');
|
||||
fwrite($stream, $data);
|
||||
rewind($stream);
|
||||
return $stream;
|
||||
}
|
||||
|
||||
public function testFileGetContents() {
|
||||
$data = 'foobar';
|
||||
$stream = $this->getDataStream($data);
|
||||
$path = \Icewind\Streams\PathWrapper::getPath($stream);
|
||||
$this->assertSame($data, file_get_contents($path));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue