You are here

protected function ConditionalFieldTestBase::createCondition in Conditional Fields 4.x

Same name and namespace in other branches
  1. 8 tests/src/FunctionalJavascript/ConditionalFieldTestBase.php \Drupal\Tests\conditional_fields\FunctionalJavascript\ConditionalFieldTestBase::createCondition()

Create basic fields' dependency.

Parameters

string $dependent: Machine name of dependent field.

string $dependee: Machine name of dependee field.

string $state: Dependent field state.

string $condition: Condition value.

117 calls to ConditionalFieldTestBase::createCondition()
ConditionalFieldCheckboxesTest::testVisibleValueAnd in tests/src/FunctionalJavascript/ConditionalFieldCheckboxesTest.php
Target field is Visible when control field has value with AND condition.
ConditionalFieldCheckboxesTest::testVisibleValueNot in tests/src/FunctionalJavascript/ConditionalFieldCheckboxesTest.php
Target field is Visible when control field has value with NOT condition.
ConditionalFieldCheckboxesTest::testVisibleValueOr in tests/src/FunctionalJavascript/ConditionalFieldCheckboxesTest.php
Target field is Visible when the control field has value with OR condition.
ConditionalFieldCheckboxesTest::testVisibleValueRegExp in tests/src/FunctionalJavascript/ConditionalFieldCheckboxesTest.php
Target field is Visible when the control field has value from regex.
ConditionalFieldCheckboxesTest::testVisibleValueWidget in tests/src/FunctionalJavascript/ConditionalFieldCheckboxesTest.php
The target field is Visible when the control field has value from Widget.

... See full list

File

tests/src/FunctionalJavascript/ConditionalFieldTestBase.php, line 123

Class

ConditionalFieldTestBase
Base setup for ConditionalField tests.

Namespace

Drupal\Tests\conditional_fields\FunctionalJavascript

Code

protected function createCondition($dependent, $dependee, $state, $condition) {
  $edit = [
    'table[add_new_dependency][dependent][]' => $dependent,
    'table[add_new_dependency][dependee]' => $dependee,
    'table[add_new_dependency][state]' => $state,
    'table[add_new_dependency][condition]' => $condition,
  ];
  $this
    ->submitForm($edit, 'Add dependency');

  // The Status code not supported on WebDriverTestBase since 8.4 core. See
  // more information on See https://www.drupal.org/node/2857562
}