function TMGMTEntitySourceListTestCase::setUp in Translation Management Tool 7
Overrides DrupalWebTestCase::setUp()
Overrides TMGMTBaseTestCase::setUp
File
- sources/
entity/ ui/ tmgmt_entity_ui.list.test, line 16
Class
Code
function setUp() {
parent::setUp(array(
'tmgmt_entity_ui',
'translation',
'comment',
'taxonomy',
));
$this
->loginAsAdmin(array(
'administer entity translation',
));
$this
->setEnvironment('de');
$this
->setEnvironment('fr');
// Enable entity translations for nodes and comments.
$edit = array();
$edit['entity_translation_entity_types[comment]'] = 1;
$edit['entity_translation_entity_types[node]'] = 1;
$edit['entity_translation_entity_types[taxonomy_term]'] = 1;
$this
->drupalPost('admin/config/regional/entity_translation', $edit, t('Save configuration'));
$this
->createNodeType('article', 'Article', ENTITY_TRANSLATION_ENABLED);
$this
->createNodeType('page', 'Page', TRANSLATION_ENABLED);
// Create nodes that will be used during tests.
// NOTE that the order matters as results are read by xpath based on
// position in the list.
$this->nodes['page']['en'][] = $this
->createNode('page');
$this->nodes['article']['de'][0] = $this
->createNode('article', 'de');
$this->nodes['article']['fr'][0] = $this
->createNode('article', 'fr');
$this->nodes['article']['en'][3] = $this
->createNode('article', 'en');
$this->nodes['article']['en'][2] = $this
->createNode('article', 'en');
$this->nodes['article']['en'][1] = $this
->createNode('article', 'en');
$this->nodes['article']['en'][0] = $this
->createNode('article', 'en');
}