projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
INFRA-132 - tests/ - Misc
[civicrm-core.git]
/
tests
/
phpunit
/
CiviTest
/
CiviDBAssert.php
diff --git
a/tests/phpunit/CiviTest/CiviDBAssert.php
b/tests/phpunit/CiviTest/CiviDBAssert.php
index bddce13efb0fb08ad65b895eb31af45d533b4159..f5218330891dd171a7d1a0bfd52f753f36148443 100644
(file)
--- a/
tests/phpunit/CiviTest/CiviDBAssert.php
+++ b/
tests/phpunit/CiviTest/CiviDBAssert.php
@@
-1,7
+1,7
@@
<?php
/*
+--------------------------------------------------------------------+
<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.
5
|
+ | CiviCRM version 4.
6
|
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
@@
-44,7
+44,7
@@
class CiviDBAssert {
* that a DELETE occurred
* @delete boolean True if we're checking that a DELETE action occurred.
*/
* that a DELETE occurred
* @delete boolean True if we're checking that a DELETE action occurred.
*/
- function assertDBState(&$testCase, $daoName, $id, $match, $delete = FALSE) {
+
public
function assertDBState(&$testCase, $daoName, $id, $match, $delete = FALSE) {
if (empty($id)) {
// adding this here since developers forget to check for an id
// and hence we get the first value in the db
if (empty($id)) {
// adding this here since developers forget to check for an id
// and hence we get the first value in the db
@@
-91,7
+91,7
@@
class CiviDBAssert {
/**
* Request a record from the DB by seachColumn+searchValue. Success if a record is found.
*/
/**
* Request a record from the DB by seachColumn+searchValue. Success if a record is found.
*/
- function assertDBNotNull(&$testCase, $daoName, $searchValue, $returnColumn, $searchColumn, $message) {
+
public
function assertDBNotNull(&$testCase, $daoName, $searchValue, $returnColumn, $searchColumn, $message) {
if (empty($searchValue)) {
$testCase->fail("empty value passed to assertDBNotNull");
}
if (empty($searchValue)) {
$testCase->fail("empty value passed to assertDBNotNull");
}
@@
-104,7
+104,7
@@
class CiviDBAssert {
/**
* Request a record from the DB by seachColumn+searchValue. Success if returnColumn value is NULL.
*/
/**
* Request a record from the DB by seachColumn+searchValue. Success if returnColumn value is NULL.
*/
- function assertDBNull(&$testCase, $daoName, $searchValue, $returnColumn, $searchColumn, $message) {
+
public
function assertDBNull(&$testCase, $daoName, $searchValue, $returnColumn, $searchColumn, $message) {
$value = CRM_Core_DAO::getFieldValue($daoName, $searchValue, $returnColumn, $searchColumn);
$testCase->assertNull($value, $message);
}
$value = CRM_Core_DAO::getFieldValue($daoName, $searchValue, $returnColumn, $searchColumn);
$testCase->assertNull($value, $message);
}
@@
-112,7
+112,7
@@
class CiviDBAssert {
/**
* Request a record from the DB by id. Success if row not found.
*/
/**
* Request a record from the DB by id. Success if row not found.
*/
- function assertDBRowNotExist(&$testCase, $daoName, $id, $message) {
+
public
function assertDBRowNotExist(&$testCase, $daoName, $id, $message) {
$value = CRM_Core_DAO::getFieldValue($daoName, $id, 'id', 'id');
$testCase->assertNull($value, $message);
}
$value = CRM_Core_DAO::getFieldValue($daoName, $id, 'id', 'id');
$testCase->assertNull($value, $message);
}
@@
-121,14
+121,15
@@
class CiviDBAssert {
* Compare a single column value in a retrieved DB record to an expected value
*
* @param $testCase
* Compare a single column value in a retrieved DB record to an expected value
*
* @param $testCase
- * @param $daoName
+ * @param
string
$daoName
* @param $searchValue
* @param $returnColumn
* @param $searchColumn
* @param $expectedValue
* @param string $message
*/
* @param $searchValue
* @param $returnColumn
* @param $searchColumn
* @param $expectedValue
* @param string $message
*/
- function assertDBCompareValue(&$testCase, $daoName, $searchValue, $returnColumn, $searchColumn,
+ function assertDBCompareValue(
+ &$testCase, $daoName, $searchValue, $returnColumn, $searchColumn,
$expectedValue, $message
) {
$value = CRM_Core_DAO::getFieldValue($daoName, $searchValue, $returnColumn, $searchColumn);
$expectedValue, $message
) {
$value = CRM_Core_DAO::getFieldValue($daoName, $searchValue, $returnColumn, $searchColumn);
@@
-138,12
+139,11
@@
class CiviDBAssert {
/**
* 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
*/
- function assertDBCompareValues(&$testCase, $daoName, $searchParams, $expectedValues) {
+
public
function assertDBCompareValues(&$testCase, $daoName, $searchParams, $expectedValues) {
//get the values from db
$dbValues = array();
CRM_Core_DAO::commonRetrieve($daoName, $searchParams, $dbValues);
//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);
}
// compare db values with expected values
self::assertAttributesEquals($testCase, $expectedValues, $dbValues);
}
@@
-153,7
+153,7
@@
class CiviDBAssert {
* @param $expectedValues
* @param $actualValues
*/
* @param $expectedValues
* @param $actualValues
*/
- function assertAttributesEquals(&$testCase, &$expectedValues, &$actualValues) {
+
public
function assertAttributesEquals(&$testCase, &$expectedValues, &$actualValues) {
foreach ($expectedValues as $paramName => $paramValue) {
if (isset($actualValues[$paramName])) {
$testCase->assertEquals($paramValue, $actualValues[$paramName]);
foreach ($expectedValues as $paramName => $paramValue) {
if (isset($actualValues[$paramName])) {
$testCase->assertEquals($paramValue, $actualValues[$paramName]);