| 7 text.test | TextTranslationTestCase::setUp() |
| 8 text.test | TextTranslationTestCase::setUp() |
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix. A temporary files directory is created with the same name as the database prefix.
Parameters
...: List of modules to enable for the duration of the test. This can be either a single array or a variable number of string arguments.
Overrides DrupalWebTestCase::setUp
File
- modules/
field/ modules/ text/ text.test, line 417 - Tests for text.module.
Code
function setUp() {
parent::setUp('locale', 'translation');
$full_html_format = filter_format_load('full_html');
$this->format = $full_html_format->format;
$this->admin = $this->drupalCreateUser(array(
'administer languages',
'administer content types',
'access administration pages',
'bypass node access',
filter_permission_name($full_html_format),
));
$this->translator = $this->drupalCreateUser(array('create article content', 'edit own article content', 'translate content'));
// Enable an additional language.
$this->drupalLogin($this->admin);
$edit = array('langcode' => 'fr');
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
// Set "Article" content type to use multilingual support with translation.
$edit = array('language_content_type' => 2);
$this->drupalPost('admin/structure/types/manage/article', $edit, t('Save content type'));
$this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Article')), t('Article content type has been updated.'));
}
Login or register to post comments