INFRA-124 - CiviUnitTestCase - Reset the session-scoped user ID between tests
authorTim Otten <totten@civicrm.org>
Sat, 25 Oct 2014 07:22:07 +0000 (03:22 -0400)
committerTim Otten <totten@civicrm.org>
Sat, 25 Oct 2014 07:22:07 +0000 (03:22 -0400)
tests/phpunit/CiviTest/CiviUnitTestCase.php

index 50ead2bc4632d543dfd6bc28fff4e17d7eb8f9f9..382d2310587d9bb28a2c18e1907894b5fd9d0848 100644 (file)
@@ -325,6 +325,9 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
    *  Common setup functions for all unit tests
    */
   protected function setUp() {
+    $session = CRM_Core_Session::singleton();
+    $session->set('userID', NULL);
+
     CRM_Utils_Hook::singleton(TRUE);
     $this->errorScope = CRM_Core_TemporaryErrorScope::useException(); // REVERT
     //  Use a temporary file for STDIN