function PathLanguageTestCase::setUp

Overrides DrupalWebTestCase::setUp

File

modules/path/path.test, line 351

Class

PathLanguageTestCase
Tests URL aliases for translated nodes.

Code

function setUp() {
    parent::setUp('path', 'locale', 'translation');
    // Create and login user.
    $this->web_user = $this->drupalCreateUser(array(
        'edit any page content',
        'create page content',
        'administer url aliases',
        'create url aliases',
        'administer languages',
        'translate content',
        'access administration pages',
    ));
    $this->drupalLogin($this->web_user);
    // Enable French language.
    $edit = array();
    $edit['langcode'] = 'fr';
    $this->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
    // Enable URL language detection and selection.
    $edit = array(
        'language[enabled][locale-url]' => 1,
    );
    $this->drupalPost('admin/config/regional/language/configure', $edit, t('Save settings'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.