You are here

public function AssertRateWidgetTrait::assertThumbsUp in Rate 8

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

Assert "Thumbs Up".

Parameters

int $expected: The expected result of voting. Sum of votes (e.g. 2).

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

File

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

Class

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

Namespace

Drupal\Tests\rate\Traits

Code

public function assertThumbsUp($expected) {
  $session = $this
    ->assertSession();
  $session
    ->elementExists('css', '.rate-widget-thumbs-up');
  $session
    ->elementTextContains('css', '.rate-score', $expected);
}