diff --git a/src/Repos/FakeLogsRepo.php b/src/Repos/FakeLogsRepo.php index b392884..827b5a0 100644 --- a/src/Repos/FakeLogsRepo.php +++ b/src/Repos/FakeLogsRepo.php @@ -5,8 +5,8 @@ class FakeLogsRepo implements LogsRepoInterface { - private $config; - private $logs; + protected $config; + protected $logs; public function __construct(array $config) { diff --git a/src/Repos/FakeRemoteLogsRepo.php b/src/Repos/FakeRemoteLogsRepo.php new file mode 100644 index 0000000..55d05ab --- /dev/null +++ b/src/Repos/FakeRemoteLogsRepo.php @@ -0,0 +1,15 @@ +config['enabled_remote'] && !$this->config['remote_disk']) { + throw new Exception("remote_disk not configured for Laravel Log Keeper"); + } + } +} \ No newline at end of file diff --git a/src/Repos/RemoteLogsRepo.php b/src/Repos/RemoteLogsRepo.php index dc87a0c..d9333a9 100644 --- a/src/Repos/RemoteLogsRepo.php +++ b/src/Repos/RemoteLogsRepo.php @@ -1,5 +1,6 @@ config = $config; if ($this->config['enabled_remote'] && !$this->config['remote_disk']) { - throw new \Exception("remote_disk not configured for Laravel Log Keeper"); + throw new Exception("remote_disk not configured for Laravel Log Keeper"); } $this->localLogPath = storage_path('logs'); @@ -57,7 +58,7 @@ public function getCompressed() public function compress($log, $compressedName) { - throw new \Exception("Method not implemented yet"); + throw new Exception("Method not implemented yet"); // TODO: Implement compress() method. } diff --git a/tests/Repos/FakeRemoteLogsRepoTest.php b/tests/Repos/FakeRemoteLogsRepoTest.php new file mode 100644 index 0000000..83f04c4 --- /dev/null +++ b/tests/Repos/FakeRemoteLogsRepoTest.php @@ -0,0 +1,29 @@ +fail('It should not get here'); + } catch (Exception $e) { + $this->assertSame('remote_disk not configured for Laravel Log Keeper', $e->getMessage()); + } + + } + + + + +} \ No newline at end of file diff --git a/tests/Services/LogKeeperServiceTest.php b/tests/Services/LogKeeperServiceTest.php index 91ace72..9b8dcea 100644 --- a/tests/Services/LogKeeperServiceTest.php +++ b/tests/Services/LogKeeperServiceTest.php @@ -226,5 +226,4 @@ public function it_does_nothing_remotely_if_enabled_remote_is_false() $this->assertSame(["laravel-today-{$today->toDateString()}.log"], $logs); $this->assertSame([], $remoteRepo->getCompressed()); } - -} \ No newline at end of file +}