| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* @match array Associative array of field name => expected value. Empty if asserting
* that a DELETE occurred
* @delete boolean True if we're checking that a DELETE action occurred.
+ * @param $testCase
+ * @param $daoName
+ * @param $id
+ * @param $match
+ * @param bool $delete
*/
public function assertDBState(&$testCase, $daoName, $id, $match, $delete = FALSE) {
if (empty($id)) {
$testCase->fail('ID not populated. Please fix your assertDBState usage!!!');
}
- $object = new $daoName();
+ $object = new $daoName();
$object->id = $id;
$verifiedCount = 0;
/**
* Request a record from the DB by seachColumn+searchValue. Success if a record is found.
+ * @param $testCase
+ * @param $daoName
+ * @param $searchValue
+ * @param $returnColumn
+ * @param $searchColumn
+ * @param $message
+ * @return null|string
*/
public function assertDBNotNull(&$testCase, $daoName, $searchValue, $returnColumn, $searchColumn, $message) {
if (empty($searchValue)) {
/**
* Request a record from the DB by seachColumn+searchValue. Success if returnColumn value is NULL.
+ * @param $testCase
+ * @param $daoName
+ * @param $searchValue
+ * @param $returnColumn
+ * @param $searchColumn
+ * @param $message
*/
public function assertDBNull(&$testCase, $daoName, $searchValue, $returnColumn, $searchColumn, $message) {
$value = CRM_Core_DAO::getFieldValue($daoName, $searchValue, $returnColumn, $searchColumn);
/**
* Request a record from the DB by id. Success if row not found.
+ * @param $testCase
+ * @param $daoName
+ * @param $id
+ * @param $message
*/
public function assertDBRowNotExist(&$testCase, $daoName, $id, $message) {
$value = CRM_Core_DAO::getFieldValue($daoName, $id, 'id', 'id');
}
/**
- * Compare a single column value in a retrieved DB record to an expected value
+ * Compare a single column value in a retrieved DB record to an expected value.
*
* @param $testCase
* @param string $daoName
* @param $expectedValue
* @param string $message
*/
- function assertDBCompareValue(&$testCase, $daoName, $searchValue, $returnColumn, $searchColumn,
+ public function assertDBCompareValue(
+ &$testCase, $daoName, $searchValue, $returnColumn, $searchColumn,
$expectedValue, $message
) {
$value = CRM_Core_DAO::getFieldValue($daoName, $searchValue, $returnColumn, $searchColumn);
}
/**
- * Compare all values in a single retrieved DB record to an array of expected values
+ * Compare all values in a single retrieved DB record to an array of expected values.
+ * @param $testCase
+ * @param $daoName
+ * @param $searchParams
+ * @param $expectedValues
*/
public function assertDBCompareValues(&$testCase, $daoName, $searchParams, $expectedValues) {
//get the values from db
$dbValues = array();
CRM_Core_DAO::commonRetrieve($daoName, $searchParams, $dbValues);
-
// compare db values with expected values
self::assertAttributesEquals($testCase, $expectedValues, $dbValues);
}
}
}
}
+
}