From cf2df468d6b18602b55c3d576d62d621fca9d7b5 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 30 Apr 2020 20:30:06 -0700 Subject: [PATCH] CiviEventDispatcherTest - Fix warning on newer versions of PHP --- tests/phpunit/Civi/Core/CiviEventDispatcherTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/Civi/Core/CiviEventDispatcherTest.php b/tests/phpunit/Civi/Core/CiviEventDispatcherTest.php index 5b9c6d7687..3b1bc47fac 100644 --- a/tests/phpunit/Civi/Core/CiviEventDispatcherTest.php +++ b/tests/phpunit/Civi/Core/CiviEventDispatcherTest.php @@ -20,7 +20,7 @@ class CiviEventDispatcherTest extends \CiviUnitTestCase { $d->addListener('hook_civicrm_fakeRunnable', function() use (&$calls) { $calls['hook_civicrm_fakeRunnable'] = 1; }); - $d->dispatch('hook_civicrm_fakeRunnable', new GenericHookEvent()); + $d->dispatch('hook_civicrm_fakeRunnable', GenericHookEvent::create([])); $this->assertEquals(1, $calls['hook_civicrm_fakeRunnable']); } @@ -33,7 +33,7 @@ class CiviEventDispatcherTest extends \CiviUnitTestCase { $d->addListener('hook_civicrm_fakeDroppable', function() use (&$calls) { $calls['hook_civicrm_fakeDroppable'] = 1; }); - $d->dispatch('hook_civicrm_fakeDroppable', new GenericHookEvent()); + $d->dispatch('hook_civicrm_fakeDroppable', GenericHookEvent::create([])); $this->assertTrue(!isset($calls['hook_civicrm_fakeDroppable'])); } @@ -43,7 +43,7 @@ class CiviEventDispatcherTest extends \CiviUnitTestCase { '/^hook_civicrm_fakeFa/' => 'fail', ]); try { - $d->dispatch('hook_civicrm_fakeFailure', new GenericHookEvent()); + $d->dispatch('hook_civicrm_fakeFailure', GenericHookEvent::create([])); $this->fail('Expected exception'); } catch (\Exception $e) { -- 2.25.1