summaryrefslogtreecommitdiff
path: root/tests/FileSystemDriverTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/FileSystemDriverTest.php')
-rw-r--r--tests/FileSystemDriverTest.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/FileSystemDriverTest.php b/tests/FileSystemDriverTest.php
index 0ca1241..850f7d7 100644
--- a/tests/FileSystemDriverTest.php
+++ b/tests/FileSystemDriverTest.php
@@ -132,6 +132,15 @@ class FileSystemDriverTest extends MockeryTestCase
$this->assertStringContainsString("[{$full_date}] FileSystemDriverTest.DEBUG: test", $last_line);
}
+ public function testFileSystemDriverThrows(): void
+ {
+ $loggr = new Loggr(new FileSystemDriver('path-does-not-exist'));
+ $loggr->emergency('test');
+ $sep = DIRECTORY_SEPARATOR;
+ $date = (new DateTime())->format('Y-m-d');
+ $this->assertEquals("Log file could not be created at path: path-does-not-exist{$sep}{$date}.log", $loggr->error);
+ }
+
private function mockLogger(string &$result): Loggr
{
$driver = Mockery::mock(FileSystemDriver::class, [''])->makePartial();