You are here

trait ThunderArticleTestTrait in Thunder 8.4

Same name and namespace in other branches
  1. 8.5 tests/src/FunctionalJavascript/ThunderArticleTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderArticleTestTrait
  2. 8.2 tests/src/FunctionalJavascript/ThunderArticleTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderArticleTestTrait
  3. 8.3 tests/src/FunctionalJavascript/ThunderArticleTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderArticleTestTrait
  4. 6.2.x tests/src/FunctionalJavascript/ThunderArticleTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderArticleTestTrait
  5. 6.0.x tests/src/FunctionalJavascript/ThunderArticleTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderArticleTestTrait
  6. 6.1.x tests/src/FunctionalJavascript/ThunderArticleTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderArticleTestTrait

Trait with functionality required for Article handling.

@package Drupal\Tests\thunder\FunctionalJavascript

Hierarchy

6 files declare their use of ThunderArticleTestTrait
AccessUnpublishedTest.php in tests/src/FunctionalJavascript/Integration/AccessUnpublishedTest.php
AutofillTest.php in tests/src/FunctionalJavascript/Integration/AutofillTest.php
NestedTableDragTest.php in tests/src/FunctionalJavascript/Integration/NestedTableDragTest.php
ParagraphsFeaturesTest.php in tests/src/FunctionalJavascript/Integration/ParagraphsFeaturesTest.php
ParagraphSplitTest.php in tests/src/FunctionalJavascript/Integration/ParagraphSplitTest.php

... See full list

File

tests/src/FunctionalJavascript/ThunderArticleTestTrait.php, line 10

Namespace

Drupal\Tests\thunder\FunctionalJavascript
View source
trait ThunderArticleTestTrait {
  use ThunderFormFieldTestTrait;
  use ThunderMediaTestTrait;

  /**
   * Pre-fill defined article fields for new article.
   *
   * @param array $fieldValues
   *   Field values for new article.
   */
  public function articleFillNew(array $fieldValues) {
    if (!$this instanceof ThunderJavascriptTestBase) {
      throw new \RuntimeException('Trait is not used in correct context.');
    }
    $this
      ->drupalGet('node/add/article');
    $this
      ->assertSession()
      ->assertWaitOnAjaxRequest();
    if (!empty($fieldValues)) {
      $this
        ->expandAllTabs();
      $this
        ->setFieldValues($this
        ->getSession()
        ->getPage(), $fieldValues);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ThunderArticleTestTrait::articleFillNew public function Pre-fill defined article fields for new article.
ThunderFormFieldTestTrait::setCheckbox protected function Set value for group of checkboxes.
ThunderFormFieldTestTrait::setFieldValue public function Set value for defined field name on current page.
ThunderFormFieldTestTrait::setFieldValues public function Set fields on current page.
ThunderMediaTestTrait::createGallery public function Create gallery with selected medias.
ThunderMediaTestTrait::selectMedia public function Select Medias for field.