Browse Source

fix IntegrationTestCase

Mark Scherer 11 years ago
parent
commit
f0d7dde691
2 changed files with 16 additions and 11 deletions
  1. 12 10
      Config/bootstrap.php
  2. 4 1
      TestSuite/IntegrationTestCase.php

+ 12 - 10
Config/bootstrap.php

@@ -250,17 +250,19 @@ function safenl($str) {
 	return $str;
 }
 
-/**
- * Convenience function to check on "empty()"
- *
- * @param mixed $var
- * @return bool Result
- */
-function isEmpty($var = null) {
-	if (empty($var)) {
-		return true;
+if (!function_exists('isEmpty')) {
+	/**
+	 * Convenience function to check on "empty()"
+	 *
+	 * @param mixed $var
+	 * @return bool Result
+	 */
+	function isEmpty($var = null) {
+		if (empty($var)) {
+			return true;
+		}
+		return false;
 	}
-	return false;
 }
 
 /**

+ 4 - 1
TestSuite/IntegrationTestCase.php

@@ -204,7 +204,10 @@ abstract class IntegrationTestCase extends MyControllerTestCase {
 		if ((float)Configure::version() >= 2.7) {
 			CakeSession::clear(false);
 		} else {
-			$_SESSION = null;
+			$keys = array_keys((array)CakeSession::read());
+			foreach ($keys as $key) {
+				CakeSession::delete($key);
+			}
 		}
 	}