You are here

function NodeDisplaysFields::testNdStyles in Node displays 6.2

Same name and namespace in other branches
  1. 6.3 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(DS_PATH_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(DS_PATH_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(DS_PATH_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'));
}