INFRA-132 - tests/ - Misc
[civicrm-core.git] / tests / phpunit / CiviTest / CiviDBAssert.php
index 0d3b9b806d0bcb29e27c9fda4337b6900b49fe28..f5218330891dd171a7d1a0bfd52f753f36148443 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | 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.
    */
-  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]);