Skip to content

Commit fefad34

Browse files
committed
fix: decouple tests moving and copying fail from memory filesystem by using dedicated configs
1 parent 648ae24 commit fefad34

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/FilesystemTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,10 @@ public function publicUrl(string $path, Config $config): string
504504
*/
505505
public function copying_from_and_to_the_same_location_fails(): void
506506
{
507-
$this->expectExceptionObject(UnableToCopyFile::fromLocationTo('from.txt', 'from.txt'));
507+
$this->expectExceptionObject(UnableToCopyFile::sourceAndDestinationAreTheSame('from.txt', 'from.txt'));
508508

509-
$this->filesystem->copy('from.txt', 'from.txt');
509+
$config = [Config::OPTION_COPY_IDENTICAL_PATH => ResolveIdenticalPathConflict::FAIL];
510+
$this->filesystem->copy('from.txt', 'from.txt', $config);
510511
}
511512

512513
/**
@@ -516,7 +517,8 @@ public function moving_from_and_to_the_same_location_fails(): void
516517
{
517518
$this->expectExceptionObject(UnableToMoveFile::fromLocationTo('from.txt', 'from.txt'));
518519

519-
$this->filesystem->move('from.txt', 'from.txt');
520+
$config = [Config::OPTION_MOVE_IDENTICAL_PATH => ResolveIdenticalPathConflict::FAIL];
521+
$this->filesystem->move('from.txt', 'from.txt', $config);
520522
}
521523

522524
/**

0 commit comments

Comments
 (0)