You are here

function MerciAdminTestCase::_compareArrayForChanges in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.2

Same name and namespace in other branches
  1. 6.2 tests/merci_admin.test \MerciAdminTestCase::_compareArrayForChanges()
1 call to MerciAdminTestCase::_compareArrayForChanges()
MerciAdminTestCase::testMerciBucketContent in tests/merci_admin.test

File

tests/merci_admin.test, line 50

Class

MerciAdminTestCase

Code

function _compareArrayForChanges($fields, $data, $message, $prefix = '') {
  foreach ($fields as $key => $value) {
    $newprefix = $prefix == '' ? $key : $prefix . '][' . $key;
    if (is_array($value)) {
      $compare_to = isset($data[$key]) ? $data[$key] : array();
      $this
        ->_compareArrayForChanges($value, $compare_to, $message, $newprefix);
    }
    else {
      $this
        ->assertEqual($value, $data[$key], t($message, array(
        '!key' => $newprefix,
      )));
    }
  }
}