From 745bc66022da77a14cea00ac8b6a4364bd1d5858 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 2 May 2014 15:19:22 -0700 Subject: [PATCH] fix static vs non static method in tests --- tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php | 4 ++-- tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php | 4 ++-- tests/phpunit/CRM/Report/Form/TestCaseTest.php | 4 ++-- tests/phpunit/CiviTest/CiviReportTestCase.php | 2 ++ 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php b/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php index 6ce1ff8679..9822252491 100644 --- a/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php +++ b/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php @@ -120,7 +120,7 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase { */ public function testAll($fv, $count, $ids, $full) { // Truncate affected tables - $this->quickCleanup(self::$_tablesToTruncate); + $this->quickCleanup($this->_tablesToTruncate); // echo "testAll\n"; $op = new PHPUnit_Extensions_Database_Operation_Insert(); @@ -151,7 +151,7 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase { */ public function testContactIDs($fv, $count, $ids, $full) { // Truncate affected tables - $this->quickCleanup(self::$_tablesToTruncate); + $this->quickCleanup($this->tablesToTruncate); // echo "testContactIDs\n"; $op = new PHPUnit_Extensions_Database_Operation_Insert(); diff --git a/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php b/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php index ab4a0c0312..301d4d454a 100644 --- a/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php +++ b/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php @@ -33,7 +33,7 @@ require_once 'CiviTest/CiviReportTestCase.php'; * @package CiviCRM */ class CRM_Report_Form_Contribute_DetailTest extends CiviReportTestCase { - static $_tablesToTruncate = array( + protected $_tablesToTruncate = array( 'civicrm_contact', 'civicrm_email', 'civicrm_phone', @@ -67,7 +67,7 @@ class CRM_Report_Form_Contribute_DetailTest extends CiviReportTestCase { function setUp() { parent::setUp(); $this->foreignKeyChecksOff(); - $this->quickCleanup(self::$_tablesToTruncate); + $this->quickCleanup($this->_tablesToTruncate); } function tearDown() { diff --git a/tests/phpunit/CRM/Report/Form/TestCaseTest.php b/tests/phpunit/CRM/Report/Form/TestCaseTest.php index cc57b45e80..6084739011 100644 --- a/tests/phpunit/CRM/Report/Form/TestCaseTest.php +++ b/tests/phpunit/CRM/Report/Form/TestCaseTest.php @@ -38,7 +38,7 @@ require_once 'CiviTest/CiviReportTestCase.php'; * @package CiviCRM */ class CRM_Report_Form_TestCaseTest extends CiviReportTestCase { - static $_tablesToTruncate = array( + protected $_tablesToTruncate = array( 'civicrm_contact', 'civicrm_email', 'civicrm_phone', @@ -126,7 +126,7 @@ class CRM_Report_Form_TestCaseTest extends CiviReportTestCase { function setUp() { parent::setUp(); $this->foreignKeyChecksOff(); - $this->quickCleanup(self::$_tablesToTruncate); + $this->quickCleanup($this->_tablesToTruncate); } function tearDown() { diff --git a/tests/phpunit/CiviTest/CiviReportTestCase.php b/tests/phpunit/CiviTest/CiviReportTestCase.php index ea80c2d039..b51a0e2deb 100644 --- a/tests/phpunit/CiviTest/CiviReportTestCase.php +++ b/tests/phpunit/CiviTest/CiviReportTestCase.php @@ -38,6 +38,8 @@ class CiviReportTestCase extends CiviUnitTestCase { // Note that MySQL doesn't provide a way to list them, so we would need // to keep track ourselves (eg CRM_Core_TemporaryTableManager) or reset // the MySQL connection between test runs. + + $this->quickCleanup($this->_tablesToTruncate); parent::tearDown(); } -- 2.25.1