You are here

public function AssertRateWidgetTrait::assertYesNo in Rate 8

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

Assert "YesNo".

Parameters

int $expected_yes: The expected result of voting for 'Yes'. Sum of votes (e.g. 6).

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

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

File

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

Class

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

Namespace

Drupal\Tests\rate\Traits

Code

public function assertYesNo($expected_yes, $expected_no) {
  $session = $this
    ->assertSession();
  $session
    ->elementExists('css', '.rate-widget-yesno');
  $session
    ->elementTextContains('css', '.rate-yes', $expected_yes);
  $session
    ->elementTextContains('css', '.rate-no', $expected_no);
}