function NodeDisplaysFields::testNdStyles in Node displays 6.3
Same name and namespace in other branches
- 6.2 tests/nd.fields.test \NodeDisplaysFields::testNdStyles()
Test styles
File
- tests/
nd.fields.test, line 30 - Tests for Node displays (fields)
Class
- NodeDisplaysFields
- @file Tests for Node displays (fields)
Code
function testNdStyles() {
$admin_user = $this
->drupalCreateUser(array(
'administer nodes',
'access display suite',
'administer styles',
'administer nd',
'configure layout for nd',
'export and import settings',
'revert overridden settings',
'use PHP in custom fields',
));
$this
->drupalLogin($admin_user);
// Setup styles.
$edit = array(
'ds_styles' => 'test-class|Test class',
);
$this
->drupalPost('admin/build/ds/layout/styles', $edit, t('Save configuration'));
$page_node = $this
->drupalCreateNode();
// Save layout and assert class is default.
$edit = array(
'title[full][region]' => 'middle',
);
$this
->drupalPost('admin/build/ds/layout/page/full', $edit, t('Save'));
$this
->drupalGet('node/' . $page_node->nid);
$this
->assertNoRaw('test-class', t('Normal class'), t('Styles tests'));
// Save layout and assert class is .
$edit = array(
'title[full][region]' => 'middle',
'title[full][css-class][]' => 'test-class',
);
$this
->drupalPost('admin/build/ds/layout/page/full', $edit, t('Save'));
$this
->drupalGet('node/' . $page_node->nid);
$this
->assertRaw('field-title test-class', t('Test class found class'), t('Styles tests'));
}