You are here

function PollVoteCheckHostnameTest::setUp in Poll 8

Overrides PollTestBase::setUp

File

tests/src/Functional/PollVoteCheckHostnameTest.php, line 15

Class

PollVoteCheckHostnameTest
Check that users and anonymous users from specified ip-address can only vote once.

Namespace

Drupal\Tests\poll\Functional

Code

function setUp() {
  parent::setUp();

  // Allow anonymous users to vote on polls.
  user_role_change_permissions(AccountInterface::ANONYMOUS_ROLE, array(
    // 'vote on polls' => TRUE,
    'cancel own vote' => TRUE,
    'access polls' => TRUE,
  ));
  $this->poll
    ->setAnonymousVoteAllow(TRUE)
    ->save();
}