You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ih...@apache.org on 2013/03/18 18:39:28 UTC
[2/2] git commit: Minor fix for MongoDB tests
Updated Branches:
refs/heads/develop daf50b467 -> 1b2d8801a
Minor fix for MongoDB tests
Made tearDown() check for the mongodb extension as well as setUp()
otherwise the tests would fail if extension was not loaded, instead
of being skipped.
Signed-off-by: Ivan Habunek <iv...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/logging-log4php/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4php/commit/1b2d8801
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4php/tree/1b2d8801
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4php/diff/1b2d8801
Branch: refs/heads/develop
Commit: 1b2d8801af44c23963b4bcc5cf8afcb88d2c4ad2
Parents: f6d602f
Author: Ivan Habunek <iv...@gmail.com>
Authored: Mon Mar 18 18:37:40 2013 +0100
Committer: Ivan Habunek <iv...@gmail.com>
Committed: Mon Mar 18 18:37:40 2013 +0100
----------------------------------------------------------------------
.../php/appenders/LoggerAppenderMongoDBTest.php | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/1b2d8801/src/test/php/appenders/LoggerAppenderMongoDBTest.php
----------------------------------------------------------------------
diff --git a/src/test/php/appenders/LoggerAppenderMongoDBTest.php b/src/test/php/appenders/LoggerAppenderMongoDBTest.php
index 3be6c9c..7bdf0f2 100644
--- a/src/test/php/appenders/LoggerAppenderMongoDBTest.php
+++ b/src/test/php/appenders/LoggerAppenderMongoDBTest.php
@@ -48,9 +48,11 @@ class LoggerAppenderMongoDBTest extends PHPUnit_Framework_TestCase {
}
protected function tearDown() {
- $collection = $this->appender->getCollection();
- if ($collection !== null) {
- $collection->drop();
+ if (extension_loaded('Mongo')) {
+ $collection = $this->appender->getCollection();
+ if ($collection !== null) {
+ $collection->drop();
+ }
}
unset($this->appender);
}