function RulesTestCase::t

Same name in other branches
  1. 7.x-2.x tests/rules.test \RulesTestCase::t()

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

10 calls to RulesTestCase::t()
RulesIntegrationTestCase::testDataIntegration in d7-tests/rules_integration_test_case.test
Test data integration.
RulesIntegrationTestCase::testEntityIntegration in d7-tests/rules_integration_test_case.test
Tests entity related integration.
RulesTestCase::testAbortOnNULLValues in d7-tests/rules_test_case.test
Make sure Rules aborts when NULL values are used.
RulesTestCase::testComponentInvocations in d7-tests/rules_test_case.test
Tests invoking components from the action.
RulesTestCase::testDataSelectors in d7-tests/rules_test_case.test
Tests using data selectors.

... See full list

File

d7-tests/rules_test_case.test, line 33

Class

RulesTestCase

Code

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);
}