Skip to content

Commit 13087a8

Browse files
Add test
1 parent 59754bf commit 13087a8

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/unit/Util/FilesystemTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <sebastian@phpunit.de>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
namespace PHPUnit\Util;
11+
12+
use PHPUnit\Framework\Attributes\CoversClass;
13+
use PHPUnit\Framework\Attributes\Small;
14+
use PHPUnit\Framework\TestCase;
15+
16+
#[CoversClass(Filesystem::class)]
17+
#[Small]
18+
final class FilesystemTest extends TestCase
19+
{
20+
public function testCanResolvePathOrStream(): void
21+
{
22+
$this->assertSame('php://stdout', Filesystem::resolvePathOrStream('php://stdout'));
23+
$this->assertSame('socket://hostname:port', Filesystem::resolvePathOrStream('socket://hostname:port'));
24+
$this->assertSame(__FILE__, Filesystem::resolvePathOrStream(__FILE__));
25+
$this->assertFalse(Filesystem::resolvePathOrStream(__DIR__ . '/does-not-exist'));
26+
}
27+
}

0 commit comments

Comments
 (0)