You are here

public function CommentAlterTextTestCase::testTextFieldMultiple in Comment Alter 7

File

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

Class

CommentAlterTextTestCase
Functional tests for Comment Alter and Text fields.

Code

public function testTextFieldMultiple() {
  $field_name = $this
    ->createField('text', 'text_textfield', array(
    'cardinality' => -1,
  ));
  $old_value = $this
    ->randomName();
  $new_value = $this
    ->randomName();
  $this
    ->assertNotEqual($old_value, $new_value);
  $this
    ->createNodeThenPostComment(array(
    $field_name => array(
      LANGUAGE_NONE => array(
        0 => array(
          'value' => $old_value,
        ),
      ),
    ),
  ), array(
    "{$field_name}[" . LANGUAGE_NONE . '][1][value]' => $new_value,
  ));
  $this
    ->assertCommentDiff(array(
    $field_name => array(
      array(
        $old_value,
        $old_value,
      ),
      array(
        NULL,
        $new_value,
      ),
    ),
  ));
}