summaryrefslogtreecommitdiff
path: root/tests/LoggrTest.php
diff options
context:
space:
mode:
authorAsko Nõmm <asko@nth.ee>2024-11-10 22:28:03 +0200
committerAsko Nõmm <asko@nth.ee>2024-11-10 22:28:03 +0200
commit12b6c4b3008c2df545c537943d4e38323cfc174e (patch)
tree11e427a794832ac73657da675f3d79949443a3f6 /tests/LoggrTest.php
Initial commit
Diffstat (limited to 'tests/LoggrTest.php')
-rw-r--r--tests/LoggrTest.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/LoggrTest.php b/tests/LoggrTest.php
new file mode 100644
index 0000000..4abae86
--- /dev/null
+++ b/tests/LoggrTest.php
@@ -0,0 +1,31 @@
+<?php
+
+namespace Asko\Loggr\Tests;
+
+use Asko\Loggr\Drivers\OutputDriver;
+use Asko\Loggr\Loggr;
+use PHPUnit\Framework\TestCase;
+
+class LoggrTest extends TestCase
+{
+ /**
+ * @throws \Exception
+ */
+ public function testNoDriver(): void
+ {
+ $this->expectExceptionMessage('No driver has been set.');
+ $loggr = new Loggr();
+ $loggr->info('test');
+ }
+
+ /**
+ * @throws \Exception
+ */
+ public function testNoFormat(): void
+ {
+ $this->expectExceptionMessage('No format has been set.');
+ $loggr = new Loggr(new OutputDriver());
+ $loggr->format = null;
+ $loggr->info('test');
+ }
+} \ No newline at end of file