You are here

protected function CommentAlterTextTest::addTextField in Comment Alter 8

Adds an Text Field to the parent enity.

Parameters

int $cardinality: Cardinality of the field.

Return value

string The name of the field which was created.

2 calls to CommentAlterTextTest::addTextField()
CommentAlterTextTest::testTextFieldMultiple in tests/src/Functional/CommentAlterTextTest.php
Tests for multi-valued text field comment altering.
CommentAlterTextTest::testTextFieldSingle in tests/src/Functional/CommentAlterTextTest.php
Tests for single valued text field comment altering.

File

tests/src/Functional/CommentAlterTextTest.php, line 28

Class

CommentAlterTextTest
Tests the comment alter module functions for text fields.

Namespace

Drupal\Tests\comment_alter\Functional

Code

protected function addTextField($cardinality) {
  return $this
    ->addField('text', 'text_textfield', [
    'cardinality' => $cardinality,
  ]);
}