ThunderArticleTestTrait.php in Thunder 8.3
Same filename and directory in other branches
- 8.5 tests/src/FunctionalJavascript/ThunderArticleTestTrait.php
- 8.2 tests/src/FunctionalJavascript/ThunderArticleTestTrait.php
- 8.4 tests/src/FunctionalJavascript/ThunderArticleTestTrait.php
- 6.2.x tests/src/FunctionalJavascript/ThunderArticleTestTrait.php
- 6.0.x tests/src/FunctionalJavascript/ThunderArticleTestTrait.php
- 6.1.x tests/src/FunctionalJavascript/ThunderArticleTestTrait.php
File
tests/src/FunctionalJavascript/ThunderArticleTestTrait.phpView source
<?php
namespace Drupal\Tests\thunder\FunctionalJavascript;
/**
* Trait with functionality required for Article handling.
*
* @package Drupal\Tests\thunder\FunctionalJavascript
*/
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);
}
}
}
Traits
Name | Description |
---|---|
ThunderArticleTestTrait | Trait with functionality required for Article handling. |