streams/tests/PathWrapperTest.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

25 lines
591 B
PHP

<?php
/**
* SPDX-FileCopyrightText: 2016 Robin Appelman <icewind@owncloud.com>
* SPDX-License-Identifier: 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));
}
}