You are here

private function WebformDefaultFieldsTestCase::_addTestComponent in Webform Default Fields 6

Same name and namespace in other branches
  1. 7 tests/webform_default_fields.test \WebformDefaultFieldsTestCase::_addTestComponent()
  2. 7.3 tests/webform_default_fields.test \WebformDefaultFieldsTestCase::_addTestComponent()
2 calls to WebformDefaultFieldsTestCase::_addTestComponent()
WebformDefaultFieldsTestCase::testNodeAdding in tests/webform_default_fields.test
WebformDefaultFieldsTestCase::testNodeAddingWithTwoFields in tests/webform_default_fields.test

File

tests/webform_default_fields.test, line 34
Webform Default Fields module tests.

Class

WebformDefaultFieldsTestCase
@file Webform Default Fields module tests.

Code

private function _addTestComponent() {
  $nid = _webform_default_fields_container_node($this->_content_type);
  $component = array(
    'nid' => $nid,
    'form_key' => $this->_field_counter . uniqid(),
    'name' => 'Test field ' . $this->_field_counter,
    'type' => 'textfield',
    'extra' => array(
      'title_display' => 'before',
      'disabled' => 0,
      'unique' => 0,
      'conditional_operator' => '=',
    ),
    'mandatory' => 0,
    'weight' => $this->_field_counter,
  );
  webform_component_insert($component);
  $this->_field_counter++;
}