You are here

public function CommentAlterListTextTestCase::testOptionsButtonsSingle in Comment Alter 7

File

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

Class

CommentAlterListTextTestCase
Functional tests for Comment Alter and List (text) fields.

Code

public function testOptionsButtonsSingle() {
  $field_name = $this
    ->createField('list_text', 'options_buttons', array(
    'settings' => array(
      'allowed_values' => array(
        1 => 'One',
        2 => 'Two',
        3 => 'Three',
      ),
    ),
    'cardinality' => 1,
  ));
  $this
    ->createNodeThenPostComment(array(
    $field_name => array(
      LANGUAGE_NONE => array(
        0 => array(
          'value' => 1,
        ),
      ),
    ),
  ), array(
    "{$field_name}[" . LANGUAGE_NONE . ']' => '2',
  ));
  $this
    ->assertCommentDiff(array(
    $field_name => array(
      array(
        'One',
        'Two',
      ),
    ),
  ));
}