You are here

public function ViewsTranslatableTest::testTranslation in Views (for Drupal 7) 7.3

Make sure that the translations get into the loaded view.

File

tests/views_translatable.test, line 85
Definition of ViewsTranslatableTest.

Class

ViewsTranslatableTest
Tests Views pluggable translations.

Code

public function testTranslation() {
  $view = $this
    ->view_unpack_translatable();
  $view
    ->set_display('default');
  $this
    ->executeView($view);
  $expected_strings = array();
  foreach ($this->strings as $string) {
    $expected_strings[] = $string .= '-translated';
  }
  $this
    ->assertEqual(sort($expected_strings), sort($view->localization_plugin->translated_strings), 'Make sure that every string got loaded translated');
}