CRM-20455 - Allow CRM_Core_DAOTest w/packages#259
authorTim Otten <totten@civicrm.org>
Thu, 25 Jul 2019 05:48:47 +0000 (22:48 -0700)
committerTim Otten <totten@civicrm.org>
Thu, 25 Jul 2019 05:48:47 +0000 (22:48 -0700)
tests/phpunit/CRM/Core/DAOTest.php
tests/phpunit/CiviTest/CiviUnitTestCase.php

index fea1a1aefe6046ee02f1dfac24b41151cc62e17e..667a7e1943e52e8b4a514fb5e75f5ead2d214b28 100644 (file)
@@ -483,7 +483,7 @@ class CRM_Core_DAOTest extends CiviUnitTestCase {
    * @throws \Exception
    */
   public function testModifyQuery() {
-    $listener = function(\Civi\Core\Event\GenericHookEvent $e) {
+    $listener = function(\Symfony\Component\EventDispatcher\Event $e) {
       $e->query = '/* User :  hooked */' . $e->query;
     };
     Civi::dispatcher()->addListener('civi.db.query', $listener);
@@ -498,7 +498,7 @@ class CRM_Core_DAOTest extends CiviUnitTestCase {
    * Demonstrate it is modified showing the query now breaks.
    */
   public function testModifyAndBreakQuery() {
-    $listener = function(\Civi\Core\Event\GenericHookEvent $e) {
+    $listener = function($e) {
       $e->query = '/* Forgot trailing comment marker' . $e->query;
     };
     Civi::dispatcher()->addListener('civi.db.query', $listener);
index 0ba0ce240d6afbec415ec743ef648d5ef3922d78..31e8091bc8aab2f1c56866f59d3a78cac1b8e9dc 100644 (file)
@@ -344,7 +344,7 @@ class CiviUnitTestCase extends PHPUnit\Framework\TestCase {
     CRM_Utils_System::flushCache();
 
     // initialize the object once db is loaded
-    \Civi::reset();
+    \Civi::$statics = array();
     // ugh, performance
     $config = CRM_Core_Config::singleton(TRUE, TRUE);