You are here

public function FacetapiApiFunctions::testTranslateString in Facet API 7

Same name and namespace in other branches
  1. 7.2 tests/facetapi.test \FacetapiApiFunctions::testTranslateString()

Tests the facetapi_translate_string() functionality.

The Facet API Test module is not set as the translator module, so we do it by setting the variable in this function. This prevetns it from interfering with other tests.

See also

facetapi_translate_string().

File

tests/facetapi.test, line 427
Tests for the Facet API module.

Class

FacetapiApiFunctions
Test cases for low level API functions.

Code

public function testTranslateString() {

  // Sets Facet API Test as the translator module.
  variable_set('facetapi:translator_module', 'facetapi_test');
  $translated = facetapi_translate_string('name', 'untranslated');
  $array = unserialize($translated);
  $this
    ->assertEqual($array['return'], 'translated', t('String translated by facetapi_translate_string().'), 'Facet API');
}