You are here

public function ThunderParagraphsTestTrait::addTextParagraph in Thunder 6.0.x

Same name and namespace in other branches
  1. 8.5 tests/src/FunctionalJavascript/ThunderParagraphsTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderParagraphsTestTrait::addTextParagraph()
  2. 8.2 tests/src/FunctionalJavascript/ThunderParagraphsTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderParagraphsTestTrait::addTextParagraph()
  3. 8.3 tests/src/FunctionalJavascript/ThunderParagraphsTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderParagraphsTestTrait::addTextParagraph()
  4. 8.4 tests/src/FunctionalJavascript/ThunderParagraphsTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderParagraphsTestTrait::addTextParagraph()
  5. 6.2.x tests/src/FunctionalJavascript/ThunderParagraphsTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderParagraphsTestTrait::addTextParagraph()
  6. 6.1.x tests/src/FunctionalJavascript/ThunderParagraphsTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderParagraphsTestTrait::addTextParagraph()

Adding text type paragraphs.

Parameters

string $fieldName: Field name.

string $text: Text for paragraph.

string $type: Type of text paragraph.

int $position: Position of the paragraph.

10 calls to ThunderParagraphsTestTrait::addTextParagraph()
AccessUnpublishedTest::testAccessUnpublished in tests/src/FunctionalJavascript/Integration/AccessUnpublishedTest.php
Testing integration of "access_unpublished" module.
ArticleCreationTest::testCreateArticle in tests/src/FunctionalJavascript/ArticleCreationTest.php
Test Creation of Article.
AutosaveFormTest::makeFormChanges in tests/src/FunctionalJavascript/Integration/AutosaveFormTest.php
Make some changes to the article.
ChannelsTagsTest::testChannelsCreation in tests/src/FunctionalJavascript/ChannelsTagsTest.php
Test channel creation, tagging of articles and channel page with articles.
ModuleIntegrationTest::testDiffModule in tests/src/FunctionalJavascript/ModuleIntegrationTest.php
Testing integration of "diff" module.

... See full list

File

tests/src/FunctionalJavascript/ThunderParagraphsTestTrait.php, line 186

Class

ThunderParagraphsTestTrait
Trait for handling of Paragraph related test actions.

Namespace

Drupal\Tests\thunder\FunctionalJavascript

Code

public function addTextParagraph($fieldName, $text, $type = 'text', $position = NULL) {
  $paragraphIndex = $this
    ->addParagraph($fieldName, $type, $position);
  if (!empty($text)) {
    $this
      ->fillCkEditor("textarea[name='{$fieldName}[{$paragraphIndex}][subform][field_text][0][value]']", $text);
  }
}