Skip to content

Commit 224965d

Browse files
committed
test: cover only unix
1 parent cf039f6 commit 224965d

File tree

1 file changed

+8
-30
lines changed

1 file changed

+8
-30
lines changed

src/Tempest/Support/tests/Filesystem/FunctionsTest.php renamed to src/Tempest/Support/tests/Filesystem/UnixFunctionsTest.php

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
use Tempest\Support\Filesystem\Exceptions\NotSymbolicLinkException;
1212
use Tempest\Support\Filesystem\Exceptions\RuntimeException;
1313

14-
use function Tempest\Support\Path\normalize;
15-
16-
final class FunctionsTest extends TestCase
14+
final class UnixFunctionsTest extends TestCase
1715
{
18-
private string $fixtures;
16+
private string $fixtures = __DIR__ . '/Fixtures';
1917

2018
protected function setUp(): void
2119
{
2220
parent::setUp();
2321

24-
$this->fixtures = normalize(__DIR__, '/Fixtures/', uniqid('tempest', more_entropy: true));
22+
if (PHP_OS_FAMILY === 'Windows') {
23+
$this->markTestSkipped('Irrelevant on Windows.');
24+
}
2525

2626
Filesystem\ensure_directory_empty($this->fixtures);
2727

@@ -32,7 +32,9 @@ protected function tearDown(): void
3232
{
3333
parent::tearDown();
3434

35-
Filesystem\delete_directory(dirname($this->fixtures));
35+
Filesystem\delete_directory($this->fixtures);
36+
37+
$this->assertFalse(is_dir($this->fixtures));
3638
}
3739

3840
public function test_create_directory(): void
@@ -187,10 +189,6 @@ public function test_detele_file_on_dir(): void
187189

188190
public function test_get_permissions(): void
189191
{
190-
if (PHP_OS_FAMILY === 'Windows') {
191-
$this->markTestSkipped('Irrelevant on Windows.');
192-
}
193-
194192
$file = $this->fixtures . '/file.txt';
195193

196194
file_put_contents($file, '');
@@ -202,10 +200,6 @@ public function test_get_permissions(): void
202200

203201
public function test_get_permissions_not_found(): void
204202
{
205-
if (PHP_OS_FAMILY === 'Windows') {
206-
$this->markTestSkipped('Irrelevant on Windows.');
207-
}
208-
209203
$this->expectException(NotFoundException::class);
210204

211205
Filesystem\get_permissions($this->fixtures . '/file.txt');
@@ -237,10 +231,6 @@ public function test_ensure_directory_empty_on_file(): void
237231

238232
public function test_ensure_directory_empty_keeps_permissions(): void
239233
{
240-
if (PHP_OS_FAMILY === 'Windows') {
241-
$this->markTestSkipped('Irrelevant on Windows.');
242-
}
243-
244234
$dir = $this->fixtures . '/tmp';
245235

246236
mkdir($dir, 0o755);
@@ -350,10 +340,6 @@ public function test_read_symbolic_link(): void
350340

351341
public function test_read_symbolic_link_on_non_symlink(): void
352342
{
353-
if (PHP_OS_FAMILY === 'Windows') {
354-
$this->markTestSkipped('Irrelevant on Windows.');
355-
}
356-
357343
$this->expectException(NotSymbolicLinkException::class);
358344

359345
$file = $this->fixtures . '/file.txt';
@@ -411,10 +397,6 @@ public function test_copy_non_existing_file(): void
411397

412398
public function test_copy_non_readable_file(): void
413399
{
414-
if (PHP_OS_FAMILY === 'Windows') {
415-
$this->markTestSkipped('Irrelevant on Windows.');
416-
}
417-
418400
$this->expectException(NotReadableException::class);
419401

420402
$source = $this->fixtures . '/file.txt';
@@ -450,10 +432,6 @@ public function test_write_file(): void
450432

451433
public function test_write_non_writable_file(): void
452434
{
453-
if (PHP_OS_FAMILY === 'Windows') {
454-
$this->markTestSkipped('Irrelevant on Windows.');
455-
}
456-
457435
$this->expectException(RuntimeException::class);
458436

459437
$file = $this->fixtures . '/file.txt';

0 commit comments

Comments
 (0)