X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FCiviTest%2FCiviDBAssert.php;h=f5218330891dd171a7d1a0bfd52f753f36148443;hb=5896d037d1e8eac7cc88adc80923ada36fdfb5fd;hp=0d3b9b806d0bcb29e27c9fda4337b6900b49fe28;hpb=aa0b568b0563900aa6ddc792014cc17af2c3fc90;p=civicrm-core.git diff --git a/tests/phpunit/CiviTest/CiviDBAssert.php b/tests/phpunit/CiviTest/CiviDBAssert.php index 0d3b9b806d..f521833089 100644 --- a/tests/phpunit/CiviTest/CiviDBAssert.php +++ b/tests/phpunit/CiviTest/CiviDBAssert.php @@ -1,7 +1,7 @@ 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]);