You are here

function dsBaseTest::dsCreateDynamicField in Display Suite 7

Same name and namespace in other branches
  1. 7.2 tests/ds.base.test \dsBaseTest::dsCreateDynamicField()

Create a dynamic field.

Parameters

$edit: An optional array of field properties.

2 calls to dsBaseTest::dsCreateDynamicField()
dsFieldsTests::testDSFields in tests/ds.base.test
Test Display fields.
dsLayoutsStylesTests::testDStestLayouts in tests/ds.base.test
Test selecting layouts, empty regions, classes, region to block and fields.

File

tests/ds.base.test, line 172
Base functions and tests for Display Suite.

Class

dsBaseTest
@file Base functions and tests for Display Suite.

Code

function dsCreateDynamicField($edit = array(), $url = 'admin/structure/ds/fields/manage_ctools', $first = TRUE) {
  $edit += array(
    'name' => 'Dynamic',
    'entities[node]' => '1',
  );
  if ($first) {
    $edit += array(
      'field' => 'dynamic',
    );
  }
  $this
    ->drupalPost($url, $edit, t('Save'));
  $this
    ->assertText(t('The field ' . $edit['name'] . ' has been saved'), t('!name field has been saved', array(
    '!name' => $edit['name'],
  )));
}