-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathlogger.php
42 lines (33 loc) · 993 Bytes
/
logger.php
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
32
33
34
35
36
37
38
39
40
41
42
<?php
use Jcupitt\Vips;
class VipsLoggerTest extends PHPUnit\Framework\TestCase
{
public function testGetLoggerCall()
{
// Asserts that getLogger without setting it should
// return a null value.
$logger = Vips\Config::getLogger();
$this->assertNull($logger);
}
public function testSetLoggerCall()
{
Vips\Config::setLogger(new class implements Psr\Log\LoggerInterface {
use Psr\Log\LoggerTrait;
public function log($level, $message, array $context = array())
{
// Do logging logic here.
}
});
$logger = Vips\Config::getLogger();
// Asserts that getLogger should return an instance of Psr\Log\LoggerInterface
$this->assertInstanceOf(Psr\Log\LoggerInterface::class, $logger);
}
}
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: expandtab sw=4 ts=4 fdm=marker
* vim<600: expandtab sw=4 ts=4
*/