diff --git a/Civi/Test/DbTestTrait.php b/Civi/Test/DbTestTrait.php index e8f7209e7968..06b5e60b3c63 100644 --- a/Civi/Test/DbTestTrait.php +++ b/Civi/Test/DbTestTrait.php @@ -64,7 +64,7 @@ public function assertDBState($daoName, $id, $match, $delete = FALSE) { else { $this->fail("Could not retrieve object: $daoName, $id"); } - $object->free(); + $matchSize = count($match); if ($verifiedCount != $matchSize) { $this->fail("Did not verify all fields in match array: $daoName, $id. Verified count = $verifiedCount. Match array size = $matchSize"); diff --git a/tests/phpunit/CRM/Core/BAO/RecurringEntityTest.php b/tests/phpunit/CRM/Core/BAO/RecurringEntityTest.php index 199d46873e18..7452e2cab1f5 100644 --- a/tests/phpunit/CRM/Core/BAO/RecurringEntityTest.php +++ b/tests/phpunit/CRM/Core/BAO/RecurringEntityTest.php @@ -298,7 +298,6 @@ public function testEventGeneration() { $daoRecurEvent->id = $generatedEntities['civicrm_event'][$key]; if ($daoRecurEvent->find(TRUE)) { $daoRecurEvent->delete(); - $daoRecurEvent->free(); } //Check if this event_id was deleted diff --git a/tests/phpunit/CRM/Core/DAOTest.php b/tests/phpunit/CRM/Core/DAOTest.php index 397e54ec12b5..e2bae8e16da9 100644 --- a/tests/phpunit/CRM/Core/DAOTest.php +++ b/tests/phpunit/CRM/Core/DAOTest.php @@ -373,11 +373,9 @@ public function _testMemoryUsageForUnbufferedQuery() { $dao = CRM_Core_DAO::executeQuery($sql); $contactsFetchedFromBufferedQuery = $dao->fetchAll(); - $dao->free(); $dao = CRM_Core_DAO::executeUnbufferedQuery($sql); $contactsFetchedFromUnbufferedQuery = $dao->fetchAll(); - $dao->free(); $this->checkArrayEquals($contactsFetchedFromBufferedQuery, $contactsFetchedFromUnbufferedQuery); } diff --git a/tests/phpunit/CRM/Core/FieldOptionsTest.php b/tests/phpunit/CRM/Core/FieldOptionsTest.php index b0e8370c98af..8ac635e529e4 100644 --- a/tests/phpunit/CRM/Core/FieldOptionsTest.php +++ b/tests/phpunit/CRM/Core/FieldOptionsTest.php @@ -204,8 +204,6 @@ public function testHookFieldOptionsWithCustomFields() { $this->appendOptions = array(2 => 'Maybe'); $options = CRM_Core_PseudoConstant::get('CRM_Core_BAO_CustomField', $this->targetField); $this->assertEquals(array(1 => 'Yes', 0 => 'No', 2 => 'Maybe'), $options); - - $field->free(); } /** diff --git a/tests/phpunit/CRM/Logging/LoggingTest.php b/tests/phpunit/CRM/Logging/LoggingTest.php index 880cddb22ff5..62d242320112 100644 --- a/tests/phpunit/CRM/Logging/LoggingTest.php +++ b/tests/phpunit/CRM/Logging/LoggingTest.php @@ -46,7 +46,6 @@ public function testMultilingualAlterSchemaLogging() { $logging->fixSchemaDifferencesFor('civicrm_option_value', array(), TRUE); $query = CRM_Core_DAO::executeQuery("SHOW CREATE TABLE `log_civicrm_option_value`", array(), TRUE, NULL, FALSE, FALSE); $query->fetch(); - $query->free(); $create = explode("\n", $query->Create_Table); $this->assertTrue(in_array(" `logging_test` int(11) DEFAULT '0'", $create)); $create = explode("\n", $query->Create_Table); diff --git a/tests/phpunit/CiviTest/CiviDBAssert.php b/tests/phpunit/CiviTest/CiviDBAssert.php index 328985918508..8496f9d3adf9 100644 --- a/tests/phpunit/CiviTest/CiviDBAssert.php +++ b/tests/phpunit/CiviTest/CiviDBAssert.php @@ -86,7 +86,6 @@ public function assertDBState(&$testCase, $daoName, $id, $match, $delete = FALSE else { $testCase->fail("Could not retrieve object: $daoName, $id"); } - $object->free(); $matchSize = count($match); if ($verifiedCount != $matchSize) { $testCase->fail("Did not verify all fields in match array: $daoName, $id. Verified count = $verifiedCount. Match array size = $matchSize"); diff --git a/tests/phpunit/CiviTest/CiviMailUtils.php b/tests/phpunit/CiviTest/CiviMailUtils.php index a9ee7da7a059..fd1f66599dd5 100644 --- a/tests/phpunit/CiviTest/CiviMailUtils.php +++ b/tests/phpunit/CiviTest/CiviMailUtils.php @@ -165,7 +165,6 @@ public function getMostRecentEmail($type = 'raw') { if ($dao->fetch()) { $msg = $dao->headers . "\n\n" . $dao->body; } - $dao->free(); } switch ($type) { @@ -198,7 +197,6 @@ public function getAllMessages($type = 'raw') { while ($dao->fetch()) { $msgs[] = $dao->headers . "\n\n" . $dao->body; } - $dao->free(); } switch ($type) { diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index 76d31f00158a..8880c0c15dbc 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -1073,7 +1073,6 @@ public function testLimit($entityName) { for ($i = 0; $i < 30; $i++) { $baoObj = CRM_Core_DAO::createTestObject($baoString, array('currency' => 'USD')); $ids[] = $baoObj->id; - $baoObj->free(); } // each case is array(0 => $inputtedApiOptions, 1 => $expectedResultCount) @@ -1090,7 +1089,6 @@ public function testLimit($entityName) { foreach ($ids as $id) { CRM_Core_DAO::deleteTestObjects($baoString, array('id' => $id)); } - $baoObj->free(); } /** @@ -1120,7 +1118,6 @@ public function testSqlOperators($entityName) { for ($i = 0; $i < 3 - $totalEntities; $i++) { $baoObj = CRM_Core_DAO::createTestObject($baoString, array('currency' => 'USD')); $ids[] = $baoObj->id; - $baoObj->free(); } $totalEntities = 3; } @@ -1558,7 +1555,6 @@ public function testCreateSingleValueAlter($entityName) { } } } - $baoObj->free(); } /* ---- testing the _getFields ---- */