diff --git a/src/AdapterTestUtilities/FilesystemAdapterTestCase.php b/src/AdapterTestUtilities/FilesystemAdapterTestCase.php index 5361d30f4..80ac79260 100644 --- a/src/AdapterTestUtilities/FilesystemAdapterTestCase.php +++ b/src/AdapterTestUtilities/FilesystemAdapterTestCase.php @@ -644,6 +644,38 @@ public function moving_a_file(): void }); } + /** + * @test + */ + public function file_exists_on_directory_is_false(): void + { + $this->runScenario(function () { + $adapter = $this->adapter(); + + $this->assertFalse($adapter->directoryExists('test')); + $adapter->createDirectory('test', new Config()); + + $this->assertTrue($adapter->directoryExists('test')); + $this->assertFalse($adapter->fileExists('test')); + }); + } + + /** + * @test + */ + public function directory_exists_on_file_is_false(): void + { + $this->runScenario(function () { + $adapter = $this->adapter(); + + $this->assertFalse($adapter->fileExists('test.txt')); + $adapter->write('test.txt', 'content', new Config()); + + $this->assertTrue($adapter->fileExists('test.txt')); + $this->assertFalse($adapter->directoryExists('test.txt')); + }); + } + /** * @test */