public function testException() { $dsn = 'doenotexist'; $appender = new LoggerAppenderPDO("myname"); $appender->setDSN($dsn); $appender->setCreateTable(true); $catchedException = null; try { $appender->activateOptions(); } catch (LoggerException $e) { $catchedException = $e; } self::assertNotNull($catchedException); }
/** Tests if log4php throws an Exception if the appender does not work. * @expectedException LoggerException */ public function testException() { $dsn = 'doenotexist'; $appender = new LoggerAppenderPDO("myname"); $appender->setDSN($dsn); $appender->setCreateTable(true); $appender->activateOptions(); }