function PathLanguageUITestCase::setUp

Overrides DrupalWebTestCase::setUp

File

modules/path/path.test, line 492

Class

PathLanguageUITestCase
Tests the user interface for creating path aliases, with languages.

Code

function setUp() {
    parent::setUp('path', 'locale');
    // Create and login user.
    $web_user = $this->drupalCreateUser(array(
        'edit any page content',
        'create page content',
        'administer url aliases',
        'create url aliases',
        'administer languages',
        'access administration pages',
    ));
    $this->drupalLogin($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.