protected function RangeInternationalizationWebTestCase::_testRangeFieldInstanceSettingIsTranslatable in Range 7
Verifies that given string with given context is translatable.
This method searches for a string directly in the database instead of using string translation UI, because this test is designed to verify that range module works, not the Drupal core.
Parameters
string $source: Source string.
string $context: Source string context.
1 call to RangeInternationalizationWebTestCase::_testRangeFieldInstanceSettingIsTranslatable()
- RangeInternationalizationWebTestCase::testRangeFieldInstanceSettingsAreTranslatable in tests/
range.i18n.test - Verifies that range field instance settings are translatable.
File
- tests/
range.i18n.test, line 126 - Contains range i18n tests.
Class
- RangeInternationalizationWebTestCase
- Tests translatability of range fields.
Code
protected function _testRangeFieldInstanceSettingIsTranslatable($source, $context) {
$query = db_select('locales_source', 'ls');
$query
->addExpression('1');
$query
->condition('source', $source)
->condition('context', $context)
->condition('textgroup', 'field');
$this
->assertTrue($query
->execute()
->fetchField(), format_string('Source string %string with context %context exists in locales_source database table', array(
'%string' => $source,
'%context' => $context,
)));
}