You are here

public function UiPageTest::testNegatedCondition in Rules 8.3

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

File

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

Class

UiPageTest
Tests that the Rules UI pages are reachable.

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');
}