Skip to content

Commit

Permalink
Improve cleanup of globals on ajaxTest
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Nov 21, 2018
1 parent d0df87f commit f8b0413
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/phpunit/CRM/Contact/Page/AjaxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand Down

0 comments on commit f8b0413

Please sign in to comment.