From e0001b1370fabc82d168b6b4e5e5bcccdd4e14e4 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 21 Nov 2018 20:03:44 +1300 Subject: [PATCH] Test fixes, better cleanup --- tests/phpunit/CRM/Contact/Page/AjaxTest.php | 14 ++++++++++++++ .../CRM/Contact/Page/View/UserDashBoardTest.php | 1 + 2 files changed, 15 insertions(+) diff --git a/tests/phpunit/CRM/Contact/Page/AjaxTest.php b/tests/phpunit/CRM/Contact/Page/AjaxTest.php index 488fed60c3..699cc99617 100644 --- a/tests/phpunit/CRM/Contact/Page/AjaxTest.php +++ b/tests/phpunit/CRM/Contact/Page/AjaxTest.php @@ -5,10 +5,24 @@ */ class CRM_Contact_Page_AjaxTest extends CiviUnitTestCase { + /** + * Original $_REQUEST + * + * We are messing with globals so fix afterwards. + * + * @var array + */ + protected $originalRequest = []; public function setUp() { $this->useTransaction(TRUE); parent::setUp(); + $this->originalRequest = $_REQUEST; + } + + public function tearDown() { + $_REQUEST = $this->originalRequest; + parent::tearDown(); } /** diff --git a/tests/phpunit/CRM/Contact/Page/View/UserDashBoardTest.php b/tests/phpunit/CRM/Contact/Page/View/UserDashBoardTest.php index 5dcdc8618f..63aa477d02 100644 --- a/tests/phpunit/CRM/Contact/Page/View/UserDashBoardTest.php +++ b/tests/phpunit/CRM/Contact/Page/View/UserDashBoardTest.php @@ -57,6 +57,7 @@ class CRM_Contact_Page_View_UserDashBoardTest extends CiviUnitTestCase { public function tearDown() { $this->quickCleanUpFinancialEntities(); $this->quickCleanup(['civicrm_uf_match']); + CRM_Utils_Hook::singleton()->reset(); } /** -- 2.25.1