function RulesComponentListBuilderTest::testNoContextCondition

Tests that a condition with no context can be configured.

File

tests/src/Functional/RulesComponentListBuilderTest.php, line 145

Class

RulesComponentListBuilderTest
Tests that the Rules Component list builder pages work.

Namespace

Drupal\Tests\rules\Functional

Code

public function testNoContextCondition() {
    // Setup a rule with one condition.
    $this->testCreateRulesComponent();
    $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');
}