function UiPageTest::testNegatedCondition

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

File

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

Class

UiPageTest
Tests that the Reaction Rules list builder pages work.

Namespace

Drupal\Tests\rules\Functional

Code

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