From 218c6f9cbd44ac0078d4b915b0bb20f257a06b67 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 24 Jul 2019 22:48:47 -0700 Subject: [PATCH] CRM-20455 - Allow CRM_Core_DAOTest w/packages#259 --- tests/phpunit/CRM/Core/DAOTest.php | 4 ++-- tests/phpunit/CiviTest/CiviUnitTestCase.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/CRM/Core/DAOTest.php b/tests/phpunit/CRM/Core/DAOTest.php index fea1a1aefe..667a7e1943 100644 --- a/tests/phpunit/CRM/Core/DAOTest.php +++ b/tests/phpunit/CRM/Core/DAOTest.php @@ -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); diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 0ba0ce240d..31e8091bc8 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -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); -- 2.25.1