You are here

protected function NodeVoteTrait::voteFivestar in Rate 8

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

Vote Fivestar for the single node.

Parameters

int $stars: The number of stars vote (from 1 to 5).

6 calls to NodeVoteTrait::voteFivestar()
NodeFivestarWidgetTest::testVoting in tests/src/Functional/NodeFivestarWidgetTest.php
Tests voting.
NodeFivestarWidgetTest::testVoting in tests/src/FunctionalJavascript/NodeFivestarWidgetTest.php
Tests voting.
NodeMultipleWidgetTest::testVoting in tests/src/Functional/NodeMultipleWidgetTest.php
Tests voting.
NodeMultipleWidgetTest::testVoting in tests/src/FunctionalJavascript/NodeMultipleWidgetTest.php
Tests voting.
RateMultilingualTest::testMultilingualNode in tests/src/Functional/RateMultilingualTest.php
Tests for multilingual node.

... See full list

File

tests/src/Traits/NodeVoteTrait.php, line 45

Class

NodeVoteTrait
Provides methods to voting on nodes.

Namespace

Drupal\Tests\rate\Traits

Code

protected function voteFivestar($stars) {
  $this
    ->assertSession()
    ->elementExists('css', '.rate-widget-fivestar');
  $this
    ->click('.rate-fivestar-' . $stars);
}