You are here

public function SearchByPageIntlTest::doLanguageTest in Search by Page 7

Same name and namespace in other branches
  1. 6 tests/search_by_page.test \SearchByPageIntlTest::doLanguageTest()

Tests that the right strings are present for the given language.

1 call to SearchByPageIntlTest::doLanguageTest()
SearchByPageIntlTest::testTranslations in tests/search_by_page.test
Tests that environment settings for main module and paths are translated.

File

tests/search_by_page.test, line 3099
Tests for the Search by Page module. By Jennifer Hodgdon of Poplar ProductivityWare, www.poplarware.com

Class

SearchByPageIntlTest
Environment internationalization test.

Code

public function doLanguageTest($lang) {

  // Figure out which strings we want to look for and verify are not there.
  $good = $this->envinfo1;
  $bad = $this->strings_to_test;
  if ($lang != 'en') {
    $bad = $this->envinfo1;
    $good = $this->strings_to_test;
  }

  // Verify that all the good strings are there and not the bad ones.
  foreach ($this->strings_to_test as $key => $ignore) {
    $this
      ->assertRaw($good[$key], "Text for {$key} in right language is present");
    $this
      ->assertNoRaw($bad[$key], "Text for {$key} in other language is not present");
  }
}