You are here

function dsBaseTest::dsCreateBlockField in Display Suite 7

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

Create a block field.

Parameters

$edit: An optional array of field properties.

3 calls to dsBaseTest::dsCreateBlockField()
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.
dsNodeTests::testDSNodeEntity in tests/ds.entities.test
Test basic node display fields.

File

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

Class

dsBaseTest
@file Base functions and tests for Display Suite.

Code

function dsCreateBlockField($edit = array(), $url = 'admin/structure/ds/fields/manage_block', $first = TRUE) {
  $edit += array(
    'name' => 'Test block field',
    'entities[node]' => '1',
    'block' => 'node|recent',
    'block_render' => DS_BLOCK_TEMPLATE,
  );
  if ($first) {
    $edit += array(
      'field' => 'test_block_field',
    );
  }
  $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'],
  )));
}