You are here

public static function RulesTestCase::t in Rules 7.2

Same name and namespace in other branches
  1. 8.3 d7-tests/rules_test_case.test \RulesTestCase::t()

Calculates the output of t() given an array of placeholders to replace.

11 calls to RulesTestCase::t()
RulesIntegrationTestCase::testDataIntegration in tests/rules.test
Tests data integration.
RulesIntegrationTestCase::testEntityIntegration in tests/rules.test
Tests entity related integration.
RulesSchedulerTestCase::testRecursionPrevention in rules_scheduler/tests/rules_scheduler.test
Makes sure recursion prevention is working fine for scheduled rule sets.
RulesTestCase::testAbortOnNULLValues in tests/rules.test
Makes sure Rules aborts when NULL values are used.
RulesTestCase::testComponentInvocations in tests/rules.test
Tests invoking components from the action.

... See full list

File

tests/rules.test, line 36
Rules tests.

Class

RulesTestCase
Rules test cases.

Code

public static function t($text, $strings) {
  $placeholders = array();
  foreach ($strings as $key => $string) {
    $key = !is_numeric($key) ? $key : $string;
    $placeholders['%' . $key] = drupal_placeholder($string);
  }
  return strtr($text, $placeholders);
}