You are here

protected function CommentAlterAdminTestCase::attachFieldToComment in Comment Alter 7

Attaches the given field name to the comment.

Parameters

string $field_name: The name of the field to attache.

2 calls to CommentAlterAdminTestCase::attachFieldToComment()
CommentAlterAdminTestCase::testNodeFieldInstanceSettings in ./comment_alter.test
CommentAlterAdminTestCase::testStatusReport in ./comment_alter.test

File

./comment_alter.test, line 265
Functional tests for the Comment Alter module.

Class

CommentAlterAdminTestCase
Functional tests for the admin UIs provided by Comment Alter.

Code

protected function attachFieldToComment($field_name) {
  field_create_instance(array(
    'field_name' => $field_name,
    'label' => "{$field_name} (comment)",
    'entity_type' => 'comment',
    'widget' => array(
      'type' => 'text_textfield',
    ),
    'bundle' => 'comment_node_' . $this->content_type,
    'settings' => array(),
  ));
}