trait ThunderArticleTestTrait in Thunder 8.5
Same name and namespace in other branches
- 8.2 tests/src/FunctionalJavascript/ThunderArticleTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderArticleTestTrait
- 8.3 tests/src/FunctionalJavascript/ThunderArticleTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderArticleTestTrait
- 8.4 tests/src/FunctionalJavascript/ThunderArticleTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderArticleTestTrait
- 6.2.x tests/src/FunctionalJavascript/ThunderArticleTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderArticleTestTrait
- 6.0.x tests/src/FunctionalJavascript/ThunderArticleTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderArticleTestTrait
- 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
- trait \Drupal\Tests\thunder\FunctionalJavascript\ThunderArticleTestTrait uses ThunderFormFieldTestTrait, ThunderMediaTestTrait
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
File
- tests/
src/ FunctionalJavascript/ ThunderArticleTestTrait.php, line 10
Namespace
Drupal\Tests\thunder\FunctionalJavascriptView 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();
if ($this
->getSession()
->getPage()
->hasButton('Customize meta tags')) {
$this
->getSession()
->getPage()
->pressButton('Customize meta tags');
$this
->assertSession()
->assertWaitOnAjaxRequest();
$this
->expandAllTabs();
}
$this
->setFieldValues($this
->getSession()
->getPage(), $fieldValues);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ThunderArticleTestTrait:: |
public | function | Pre-fill defined article fields for new article. | |
ThunderFormFieldTestTrait:: |
protected | function | Set value for group of checkboxes. | |
ThunderFormFieldTestTrait:: |
public | function | Set value for defined field name on current page. | |
ThunderFormFieldTestTrait:: |
public | function | Set fields on current page. | |
ThunderMediaTestTrait:: |
public | function | Create gallery with selected medias. | |
ThunderMediaTestTrait:: |
public | function | Select Medias for field. |