You are here

public function ThunderArticleTestTrait::articleFillNew in Thunder 8.2

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

Pre-fill defined article fields for new article.

Parameters

array $fieldValues: Field values for new article.

16 calls to ThunderArticleTestTrait::articleFillNew()
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.
ArticleCreationTest::testCreateArticleWithNoModeration in tests/src/FunctionalJavascript/ArticleCreationTest.php
Test Creation of Article without content moderation.
ArticleCreationTest::testModerationWorkflow in tests/src/FunctionalJavascript/ArticleCreationTest.php
Tests draft creation and that reverting to the default revision works.
ArticleSchedulerIntegration::testSchedulerAccess in tests/src/FunctionalJavascript/ArticleSchedulerIntegration.php
Test Creation of Article.

... See full list

File

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

Class

ThunderArticleTestTrait
Trait with functionality required for Article handling.

Namespace

Drupal\Tests\thunder\FunctionalJavascript

Code

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);
  }
}