You are here

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

Tests the unpack translation funtionality.

File

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

Class

ViewsTranslatableTest
Tests Views pluggable translations.

Code

public function testUnpackTranslatable() {
  $view = $this
    ->view_unpack_translatable();
  $view
    ->init_localization();
  $this
    ->assertEqual('views_plugin_localization_test', get_class($view->localization_plugin), 'Make sure that init_localization initializes the right translation plugin');
  $view
    ->export_locale_strings();
  $expected_strings = $this->strings;
  $result_strings = $view->localization_plugin
    ->get_export_strings();
  $this
    ->assertEqual(sort($expected_strings), sort($result_strings), 'Make sure that the localization plugin got every translatable string.');
}