Skip to content

Commit

Permalink
chore: add tests to test fileExists onto directory and vice-versa
Browse files Browse the repository at this point in the history
  • Loading branch information
tinect committed Apr 29, 2024
1 parent b744531 commit bf3934f
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/AdapterTestUtilities/FilesystemAdapterTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit bf3934f

Please sign in to comment.