function UiPageTest::testNoContextCondition

Tests that a condition with no context can be configured.

File

tests/src/Functional/UiPageTest.php, line 320

Class

UiPageTest
Tests that the Reaction Rules list builder pages work.

Namespace

Drupal\Tests\rules\Functional

Code

public function testNoContextCondition() {
    // Setup a rule with one condition.
    $this->testCreateReactionRule();
    $this->clickLink('Add condition');
    // The rules_test_true condition does not define context in its annotation.
    $this->fillField('Condition', 'rules_test_true');
    $this->pressButton('Continue');
    // Pressing 'Save' will generate an exception and the test will fail if
    // Rules does not support conditions without a context.
    // Exception: Warning: Invalid argument supplied for foreach().
    $this->pressButton('Save');
}