mirror of
https://github.com/friendica/friendica
synced 2025-04-29 17:44:24 +02:00
Adding Logger Tests
This commit is contained in:
parent
aee348fa02
commit
f63956851b
3 changed files with 38 additions and 3 deletions
|
@ -59,4 +59,15 @@ class SyslogLoggerTest extends AbstractLoggerTest
|
|||
|
||||
$logger->log('NOPE', 'a test');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test when the logfacility is wrong (string)
|
||||
* @expectedException \UnexpectedValueException
|
||||
* @expectedExceptionMessageRegExp /Can\'t open syslog for ident ".*" and facility ".*": .* /
|
||||
*/
|
||||
public function testServerException()
|
||||
{
|
||||
$logger = new SyslogLoggerWrapper('test', $this->introspection, LogLevel::DEBUG, null, 'a string');
|
||||
$logger->emergency('not working');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@ use Friendica\Util\Introspection;
|
|||
use Friendica\Util\Logger\SyslogLogger;
|
||||
use Psr\Log\LogLevel;
|
||||
|
||||
/**
|
||||
* Wraps the SyslogLogger for replacing the syslog call with a string field.
|
||||
*/
|
||||
class SyslogLoggerWrapper extends SyslogLogger
|
||||
{
|
||||
private $content;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue