PollListTest.php in Poll 8
File
tests/src/Functional/PollListTest.php
View source
<?php
namespace Drupal\Tests\poll\Functional;
class PollListTest extends PollTestBase {
public function testViewListPolls() {
$poll = $this->poll;
$poll2 = $this
->pollCreate();
$this
->drupalLogin($this->web_user);
$this
->drupalGet('admin/content/poll');
$this
->assertResponse(403);
$this
->drupalGet('polls');
$this
->assertText($poll
->label());
$this
->assertText($poll2
->label());
$edit = array(
'choice' => $this
->getChoiceId($poll, 1),
);
$this
->drupalPostForm(NULL, $edit, t('Vote'), [], 'poll-view-form-1');
$this
->assertText('Your vote has been recorded.');
$account = $this
->drupalCreateUser([
'access poll overview',
]);
$this
->drupalLogin($account);
$this
->drupalGet('admin/content/poll');
$this
->assertResponse(200);
}
}