You are here

function ContentCrudTestCase::createFieldText in Content Construction Kit (CCK) 6.2

Same name and namespace in other branches
  1. 6.3 tests/content.crud.test \ContentCrudTestCase::createFieldText()
  2. 6 tests/content.crud.test \ContentCrudTestCase::createFieldText()

Creates a textfield instance. Identical to createField() except it ensures that the text module is enabled, and adds default settings of type (text) and widget_type (text_textfield) if they are not given in $settings. @sa createField()

4 calls to ContentCrudTestCase::createFieldText()
ContentCrudBasicTest::testBasic in tests/content.crud.test
ContentCrudMultipleToSingleTest::testMultipleToSingle in tests/content.crud.test
ContentCrudSingleToMultipleTest::testSingleToMultiple in tests/content.crud.test
ContentUICrud::testFieldContentUI in tests/content.crud.test

File

tests/content.crud.test, line 307

Class

ContentCrudTestCase
Base class for CCK CRUD tests. Defines many helper functions useful for writing CCK CRUD tests.

Code

function createFieldText($settings, $content_type = 0) {
  $defaults = array(
    'type' => 'text',
    'widget_type' => 'text_textfield',
  );
  $settings = $settings + $defaults;
  return $this
    ->createField($settings, $content_type);
}