You are here

public function AssertRateWidgetTrait::assertNumberUpDown in Rate 8

Same name and namespace in other branches
  1. 8.2 tests/src/Traits/AssertRateWidgetTrait.php \Drupal\Tests\rate\Traits\AssertRateWidgetTrait::assertNumberUpDown()

Assert "Number Up / Down".

Parameters

string $expected: The expected result of voting (e.g. '-1' or '+2').

2 calls to AssertRateWidgetTrait::assertNumberUpDown()
NodeNumberUpDownWidgetTest::testVoting in tests/src/Functional/NodeNumberUpDownWidgetTest.php
Tests voting.
NodeNumberUpDownWidgetTest::testVoting in tests/src/FunctionalJavascript/NodeNumberUpDownWidgetTest.php
Tests voting.

File

tests/src/Traits/AssertRateWidgetTrait.php, line 58

Class

AssertRateWidgetTrait
Assert methods to verify results of voting for a single node.

Namespace

Drupal\Tests\rate\Traits

Code

public function assertNumberUpDown($expected) {
  $session = $this
    ->assertSession();
  $session
    ->elementExists('css', '.rate-widget-number-up-down');
  $session
    ->elementTextContains('css', '.rate-number-up-down-rating', $expected);
}