X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FCiviTest%2FCiviDBAssert.php;h=f5218330891dd171a7d1a0bfd52f753f36148443;hb=5896d037d1e8eac7cc88adc80923ada36fdfb5fd;hp=9926770b62d781e3fdd4ff2f7de9e0cf1bedf204;hpb=347185d7709adf00659d042b2fa98b93f03f2672;p=civicrm-core.git diff --git a/tests/phpunit/CiviTest/CiviDBAssert.php b/tests/phpunit/CiviTest/CiviDBAssert.php index 9926770b62..f521833089 100644 --- a/tests/phpunit/CiviTest/CiviDBAssert.php +++ b/tests/phpunit/CiviTest/CiviDBAssert.php @@ -44,7 +44,7 @@ class CiviDBAssert { * 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 @@ -91,7 +91,7 @@ class CiviDBAssert { /** * 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"); } @@ -104,7 +104,7 @@ class CiviDBAssert { /** * 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); } @@ -112,7 +112,7 @@ class CiviDBAssert { /** * 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); } @@ -128,7 +128,8 @@ class CiviDBAssert { * @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); @@ -138,12 +139,11 @@ class CiviDBAssert { /** * 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); - // compare db values with expected values self::assertAttributesEquals($testCase, $expectedValues, $dbValues); } @@ -153,7 +153,7 @@ class CiviDBAssert { * @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]);