logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ihabu...@apache.org
Subject [2/2] git commit: Minor fix for MongoDB tests
Date Mon, 18 Mar 2013 17:39:28 GMT
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 <ivan.habunek@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 <ivan.habunek@gmail.com>
Authored: Mon Mar 18 18:37:40 2013 +0100
Committer: Ivan Habunek <ivan.habunek@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);
 	}


Mime
View raw message