'Atrium translate', 'description' => 'Install Atrium in a different language.', 'group' => 'Atrium', ); } /** * Implementation of setUp(). */ function setUp() { // Change install locale, will download translation on the fly $this->install_locale = 'es'; // Set time limit, 180 (default) may not be enough for language install $this->timeLimit = 360; parent::setUp(); } function testWelcomePage() { // Check the language has been added $this->assertEqual(count(language_list()), 2, 'Two languages have been added.'); $this->assertEqual(language_default('language'), 'es', 'Spanish is the default language.'); // Check translations have been added properly $count = db_result(db_query("SELECT COUNT(*) FROM {locales_target} WHERE language = '%s'", $this->install_locale)); $this->assertTrue($count, "Translations have been loaded: $count strings."); // Create and login administrator user $admin_user = $this->atriumCreateUser('administrator'); $this->drupalLogin($admin_user); // Check initial texts // @TODO: Determine whether the t() here should actually work if the // install of the test host is not localized. // $this->assertText(t('Welcome to !sitename', array('!sitename' => variable_get('site_name', 'Drupal')))); // $this->assertText(t('Add !type.', array('!type' => node_get_types('name', 'group')))); // Check random string translations $this->assertText('Bienvenido'); $this->assertText('AƱadir Grupo'); } }