Skip to content

Commit 83ad0da

Browse files
committed
Simplified paths tests
1 parent ca38e9f commit 83ad0da

2 files changed

Lines changed: 0 additions & 106 deletions

File tree

src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Path/UnixPathTest.php

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,6 @@ public function test_absolute_path_handling() : void
6363
self::assertEquals('txt', $path->extension());
6464
}
6565

66-
public function test_add_partitions_edge_cases() : void
67-
{
68-
$path1 = new UnixPath('.');
69-
$partitioned1 = $path1->addPartitions(partition('group', 'a'));
70-
self::assertEquals('/group=a/.', $partitioned1->path());
71-
72-
$path2 = new UnixPath('\\');
73-
$partitioned2 = $path2->addPartitions(partition('group', 'b'));
74-
self::assertEquals('/group=b/\\', $partitioned2->path());
75-
}
76-
7766
public function test_basename_operations() : void
7867
{
7968
$path = new UnixPath('/path/to/file.txt');
@@ -85,22 +74,6 @@ public function test_basename_operations() : void
8574
self::assertEquals('/path/to/prefix_file.txt', $prefixed->path());
8675
}
8776

88-
public function test_basename_prefix_edge_case() : void
89-
{
90-
$path = new UnixPath('file.txt');
91-
$prefixed = $path->basenamePrefix('prefix_');
92-
93-
self::assertEquals('//prefix_file.txt', $prefixed->path());
94-
}
95-
96-
public function test_basename_prefix_root_directory() : void
97-
{
98-
$path = new UnixPath('/file.txt');
99-
$prefixed = $path->basenamePrefix('prefix_');
100-
101-
self::assertEquals('//prefix_file.txt', $prefixed->path());
102-
}
103-
10477
public function test_bracket_pattern_matching() : void
10578
{
10679
$pattern = new UnixPath('/path/file[123].txt');
@@ -403,15 +376,6 @@ public function test_randomization() : void
403376
self::assertNotEquals($path->path(), $randomized->path());
404377
}
405378

406-
public function test_randomize_edge_case() : void
407-
{
408-
$path = new UnixPath('file.txt');
409-
$randomized = $path->randomize();
410-
411-
self::assertStringStartsWith('//file_', $randomized->path());
412-
self::assertStringEndsWith('.txt', $randomized->path());
413-
}
414-
415379
public function test_randomize_without_extension() : void
416380
{
417381
$path = new UnixPath('/path/to/file');
@@ -496,14 +460,6 @@ public function test_root_partition_handling() : void
496460
self::assertEquals('file://group=a/file.txt', $partitioned->uri());
497461
}
498462

499-
public function test_set_extension_edge_case() : void
500-
{
501-
$path = new UnixPath('file');
502-
$newPath = $path->setExtension('txt');
503-
504-
self::assertEquals('//file.txt', $newPath->path());
505-
}
506-
507463
public function test_set_extension_without_existing_extension() : void
508464
{
509465
$path = new UnixPath('/path/to/file');

src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Path/WindowsPathTest.php

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,6 @@ public function test_add_partitions_complex_drive_path() : void
6969
self::assertEquals('C:/some/path/year=2023/file.txt', $partitioned->path());
7070
}
7171

72-
public function test_add_partitions_with_drive_root() : void
73-
{
74-
$path = new WindowsPath('C:/');
75-
$partitioned = $path->addPartitions(partition('group', 'a'));
76-
77-
self::assertEquals('/group=a/C:', $partitioned->path());
78-
}
79-
8072
public function test_basename_operations() : void
8173
{
8274
$path = new WindowsPath('/path/to/file.txt');
@@ -88,22 +80,6 @@ public function test_basename_operations() : void
8880
self::assertEquals('/path/to/prefix_file.txt', $prefixed->path());
8981
}
9082

91-
public function test_basename_prefix_edge_case() : void
92-
{
93-
$path = new WindowsPath('file.txt');
94-
$prefixed = $path->basenamePrefix('prefix_');
95-
96-
self::assertEquals('//prefix_file.txt', $prefixed->path());
97-
}
98-
99-
public function test_basename_prefix_root_directory() : void
100-
{
101-
$path = new WindowsPath('/file.txt');
102-
$prefixed = $path->basenamePrefix('prefix_');
103-
104-
self::assertEquals('//prefix_file.txt', $prefixed->path());
105-
}
106-
10783
public function test_bracket_pattern_matching() : void
10884
{
10985
$pattern = new WindowsPath('/path/file[123].txt');
@@ -288,18 +264,6 @@ public function test_os_agnostic_logic(string $input, string $expectedPath, stri
288264
self::assertEquals($expectedScheme, $path->protocol()->name);
289265
}
290266

291-
public function test_parent_directory_edge_cases() : void
292-
{
293-
$path1 = new WindowsPath('.');
294-
self::assertEquals('/', $path1->parentDirectory()->path());
295-
296-
$path2 = new WindowsPath('\\');
297-
self::assertEquals('/', $path2->parentDirectory()->path());
298-
299-
$path3 = new WindowsPath('C:/');
300-
self::assertEquals('/', $path3->parentDirectory()->path());
301-
}
302-
303267
/**
304268
* @dataProvider partitionProvider
305269
*/
@@ -465,24 +429,6 @@ public function test_randomization() : void
465429
self::assertNotEquals($path->path(), $randomized->path());
466430
}
467431

468-
public function test_randomize_edge_case() : void
469-
{
470-
$path = new WindowsPath('file.txt');
471-
$randomized = $path->randomize();
472-
473-
self::assertStringStartsWith('//file_', $randomized->path());
474-
self::assertStringEndsWith('.txt', $randomized->path());
475-
}
476-
477-
public function test_randomize_with_root_file() : void
478-
{
479-
$path = new WindowsPath('/file.txt');
480-
$randomized = $path->randomize();
481-
482-
self::assertStringStartsWith('//file_', $randomized->path());
483-
self::assertStringEndsWith('.txt', $randomized->path());
484-
}
485-
486432
public function test_randomize_without_extension() : void
487433
{
488434
$path = new WindowsPath('/path/to/file');
@@ -543,14 +489,6 @@ public function test_set_extension_edge_case() : void
543489
self::assertEquals('//file.txt', $newPath->path());
544490
}
545491

546-
public function test_set_extension_with_root_file() : void
547-
{
548-
$path = new WindowsPath('/file');
549-
$newPath = $path->setExtension('txt');
550-
551-
self::assertEquals('//file.txt', $newPath->path());
552-
}
553-
554492
public function test_set_extension_without_existing_extension() : void
555493
{
556494
$path = new WindowsPath('/path/to/file');

0 commit comments

Comments
 (0)