You are here

public function CommentAlterListStringTest::testOptionsButtonMultiple in Comment Alter 8

Tests for multi-valued List (string) fields comment altering.

File

tests/src/Functional/CommentAlterListStringTest.php, line 120

Class

CommentAlterListStringTest
Tests the comment alter module functions for List (string) fields.

Namespace

Drupal\Tests\comment_alter\Functional

Code

public function testOptionsButtonMultiple() {
  $field_name = $this
    ->addOptionField('options_buttons', -1);
  $this
    ->createEntityObject([
    $field_name => [
      0 => [
        'value' => 1,
      ],
    ],
  ]);
  $this
    ->postComment([
    "comment_alter_fields[{$field_name}][2]" => TRUE,
  ]);
  $this
    ->assertCommentDiff([
    $field_name => [
      [
        1,
        1,
      ],
      [
        NULL,
        2,
      ],
    ],
  ]);
  $this
    ->assertRevisionDelete();
}