You are here

protected function ConditionalFieldSelectMultipleTest::changeField in Conditional Fields 8

Same name and namespace in other branches
  1. 4.x tests/src/FunctionalJavascript/ConditionalFieldSelectMultipleTest.php \Drupal\Tests\conditional_fields\FunctionalJavascript\ConditionalFieldSelectMultipleTest::changeField()

Helper to change Field value with Javascript.

Overrides ConditionalFieldTestBase::changeField

6 calls to ConditionalFieldSelectMultipleTest::changeField()
ConditionalFieldSelectMultipleTest::testVisibleValueAnd in tests/src/FunctionalJavascript/ConditionalFieldSelectMultipleTest.php
The target field is Visible when the control field has value with AND condition.
ConditionalFieldSelectMultipleTest::testVisibleValueNot in tests/src/FunctionalJavascript/ConditionalFieldSelectMultipleTest.php
The target field is Visible when the control field has value with NOT condition.
ConditionalFieldSelectMultipleTest::testVisibleValueOr in tests/src/FunctionalJavascript/ConditionalFieldSelectMultipleTest.php
The target field is Visible when the control field has value with OR condition.
ConditionalFieldSelectMultipleTest::testVisibleValueRegExp in tests/src/FunctionalJavascript/ConditionalFieldSelectMultipleTest.php
The target field is Visible when the control field has value from Regular expression.
ConditionalFieldSelectMultipleTest::testVisibleValueWidget in tests/src/FunctionalJavascript/ConditionalFieldSelectMultipleTest.php
The target field is Visible when the control field has value from Widget.

... See full list

File

tests/src/FunctionalJavascript/ConditionalFieldSelectMultipleTest.php, line 460

Class

ConditionalFieldSelectMultipleTest
Test Conditional Fields SelectMultiple Plugin.

Namespace

Drupal\Tests\conditional_fields\FunctionalJavascript

Code

protected function changeField($selector, $value = '') {
  $value = json_encode($value);
  $this
    ->getSession()
    ->executeScript("jQuery('{$selector}').val({$value}).trigger('keyup').trigger('change');");
}