You are here

function Notifications_Templates_Tests::compareTexts in Notifications 5

1 call to Notifications_Templates_Tests::compareTexts()
Notifications_Templates_Tests::testNotificationsTemplateAPI in tests/notifications_templates.test
Play with creating, retrieving, deleting a pair subscriptions

File

tests/notifications_templates.test, line 152

Class

Notifications_Templates_Tests
Class for testing notifications module. Tests basic API functions

Code

function compareTexts($text1, $text2) {
  $diff = '';
  foreach ($text1 as $key => $value) {
    if (!isset($text2[$key])) {
      $diff .= "({$key})";
    }
    elseif (is_array($value)) {
      $diff .= $this
        ->compareTexts($text1[$key], $text2[$key]);
    }
    elseif ($value != $text2[$key]) {
      $diff .= "({$key}){$value}=" . $text2[$key];
    }
  }
  return $diff;
}