You are here

public function PURLPathAliasTest::setUp in Persistent URL 7

Same name and namespace in other branches
  1. 6 tests/purl.test \PURLPathAliasTest::setUp()

Set up test.

Overrides DrupalWebTestCase::setUp

File

tests/purl.test, line 18

Class

PURLPathAliasTest

Code

public function setUp() {
  parent::setUp('ctools', 'locale', 'path', 'purl', 'purl_test');
  $admin_user = $this
    ->drupalCreateUser(array(
    'create page content',
    'create url aliases',
    'administer languages',
    'administer site configuration',
  ));
  $this
    ->drupalLogin($admin_user);

  // Set up Spanish as second language.
  $this
    ->drupalPost('admin/config/regional/language/add', array(
    'langcode' => 'es',
  ), 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'));

  // Add a node with path alias.
  $this
    ->drupalPost('node/add/page', array(
    'title' => 'purlTest',
    'path[alias]' => 'purlTest',
  ), t('Save'));
}