Skip to content

Commit

Permalink
Merge pull request #1789 from tinect/chore/testExistViceVersa
Browse files Browse the repository at this point in the history
chore: add tests to test fileExists onto directory and vice-versa
  • Loading branch information
frankdejonge authored May 6, 2024
2 parents b744531 + bf3934f commit fffb812
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 fffb812

Please sign in to comment.