Author: grobmeier
Date: Sat May 23 21:53:52 2009
New Revision: 778039
URL: http://svn.apache.org/viewvc?rev=778039&view=rev
Log:
tested null message and null match
Modified:
incubator/log4php/trunk/src/test/php/filters/LoggerFilterStringMatchTest.php
Modified:
incubator/log4php/trunk/src/test/php/filters/LoggerFilterStringMatchTest.php
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/test/php/filters/LoggerFilterStringMatchTest.php?rev=778039&r1=778038&r2=778039&view=diff
==============================================================================
---
incubator/log4php/trunk/src/test/php/filters/LoggerFilterStringMatchTest.php
(original)
+++
incubator/log4php/trunk/src/test/php/filters/LoggerFilterStringMatchTest.php
Sat May 23 21:53:52 2009
@@ -86,4 +86,26 @@
$result = $filter->decide($eventWarn2);
self::assertEquals($result, LoggerFilter::NEUTRAL);
}
+
+ public function testDecideNullMessage() {
+ $filter = new LoggerFilterStringMatch();
+ $filter->setAcceptOnMatch("false");
+ $filter->setStringToMatch("testmessage");
+
+ $event = new LoggerLoggingEvent("LoggerAppenderEchoTest", new
Logger("TEST"), LoggerLevel::getLevelError(), null);
+
+ $result = $filter->decide($event);
+ self::assertEquals($result, LoggerFilter::NEUTRAL);
+ }
+
+ public function testDecideNullMatch() {
+ $filter = new LoggerFilterStringMatch();
+ $filter->setAcceptOnMatch("false");
+ $filter->setStringToMatch(null);
+
+ $event = new LoggerLoggingEvent("LoggerAppenderEchoTest", new
Logger("TEST"), LoggerLevel::getLevelError(), "testmessage");
+
+ $result = $filter->decide($event);
+ self::assertEquals($result, LoggerFilter::NEUTRAL);
+ }
}