summaryrefslogtreecommitdiff
path: root/tests/LoggrTest.php
blob: eb2f5ab6f082f19279309ebf9fcaccc62c75efc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
    {
        $loggr = new Loggr();
        $loggr->info('test');
        $this->assertEquals("Driver or format not set.", $loggr->error);
    }

    /**
     * @throws \Exception
     */
    public function testNoFormat(): void
    {
        $loggr = new Loggr(new OutputDriver());
        $loggr->format = null;
        $loggr->info('test');
        $this->assertEquals("Driver or format not set.", $loggr->error);
    }
}