3

I'm trying with simpletest_clone to check if my modules have the right output depending on the language.

Now my problem is, that when I do the following Code:

$this->drupalGet('de');
// check the output

$this->drupalGet('fr');
// check the output again for the french version

Drupal then checks for localhost/de/de and localhost/de/fr (de is the default language) instead of localhost/de and localhost/fr

How can I change that behaviour?

0

I would set the default langauge in code first instead.

// Get the list of languages
$languages = language_list();

// Set up the new language code
$new_lang_code = 'fr';

// Make sure the required language object is actually set
if (isset($languages[$new_lang_code])) {
  // Overwrite the global language object
  global $language;
  $language = $languages[$new_lang_code];
}

and then you just need to get the front page (and Drupal should add the prefix).

$this->drupalGet('<front>');

If front doesn't work you might need

$front_url = variable_get('site_frontpage', 'node');
$this->drupalGet($front_url);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.