public function Pathautoi18nTest::prepareTest in Pathauto i18n 7
Prepare test.
3 calls to Pathautoi18nTest::prepareTest()
- Pathautoi18nNodeTest::setUp in tests/
pathauto_i18n_node.test - SetUp method.
- Pathautoi18nTaxonomyTest::setUp in tests/
pathauto_i18n_taxonomy.test - SetUp method.
- Pathautoi18nUserTest::setUp in tests/
pathauto_i18n_user.test - SetUp method.
File
- tests/
pathauto_i18n.test.inc, line 36 - Tests for the pathauto_i18n node module.
Class
- Pathautoi18nTest
- Test functionality for nodes when language selected.
Code
public function prepareTest($modules) {
$modules[] = 'pathauto_i18n';
parent::setUp($modules);
$this->admin = $this
->drupalCreateUser(array(
'access administration pages',
'administer nodes',
'administer languages',
'administer content types',
'administer url aliases',
'create url aliases',
'administer pathauto',
));
$this
->drupalLogin($this->admin);
// Set content language and all available languages.
$this->contentLanguage = 'en';
$this->availableLanguages = array(
'en',
'fr',
'de',
);
$this->title = 'pathautoi18n';
foreach ($this->availableLanguages as $language) {
if ($language != $this->contentLanguage) {
$this
->drupalPost('admin/config/regional/language/add', array(
'langcode' => $language,
), t('Add language'));
}
}
drupal_static_reset('language_list');
// Enabel multilingual support for content type.
$this
->drupalPost('admin/structure/types/manage/article', array(
'language_content_type' => 1,
), t('Save content type'));
}