function RulesComponentListBuilderTest::testNegatedCondition

Tests that a negated condition has NOT prefixed to its label.

File

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

Class

RulesComponentListBuilderTest
Tests that the Rules Component list builder pages work.

Namespace

Drupal\Tests\rules\Functional

Code

public function testNegatedCondition() {
    // Setup a rule with one condition.
    $this->testCreateRulesComponent();
    
    /** @var \Drupal\Tests\WebAssert $assert */
    $assert = $this->assertSession();
    // Check that the label shows up on the Rule edit page.
    $assert->pageTextContains('User is blocked');
    // Edit the condition, negate it, then check the label again.
    $this->clickLink('Edit');
    $this->fillField('Negate', 1);
    $this->pressButton('Save');
    $assert->pageTextContains('NOT User is blocked');
}