static function RulesTestCase::t in Rules 8.3
Same name and namespace in other branches
- 7.2 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.
File
- d7-tests/
rules_test_case.test, line 33 - Rules 7.x tests.
Class
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);
}