public function CurrentSearchBugFixTestCase::testPluralTranslation in Facet API 7
Same name and namespace in other branches
- 7.2 contrib/current_search/tests/current_search.test \CurrentSearchBugFixTestCase::testPluralTranslation()
Tests bug fixed at http://drupal.org/node/1728496.
See also
http://drupal.org/node/1728496
File
- contrib/
current_search/ tests/ current_search.test, line 156 - Test cases for the Current Search Blocks module.
Class
- CurrentSearchBugFixTestCase
- Test cases for operations taken through the admin UI.
Code
public function testPluralTranslation() {
variable_set('facetapi:translator_module', 'facetapi_test');
// Enable the standard current search block via the UI.
$this
->drupalLogin($this->adminUser);
$this
->currentSearchEnableBlock('standard');
$this
->drupalLogin($this->authenticatedUser);
// Set the result count to 1 to test singular translation.
$this
->drupalGet('facetapi_test/search', array(
'query' => array(
'keys' => 'test',
'count' => 1,
),
));
$raw = filter_xss_admin('s:36:"current_search:standard:results:text";');
$this
->assertRaw($raw, t('Singular text in current search block is translated.'));
// Set the result count to 10 to test plural translation.
$this
->drupalGet('facetapi_test/search', array(
'query' => array(
'keys' => 'test',
'count' => 10,
),
));
$raw = filter_xss_admin('s:43:"current_search:standard:results:text_plural";');
$this
->assertRaw($raw, t('Plural text in current search block is translated.'));
}