You are here

public function AgreementAnonymousTest::testAgreement in Agreement 8.2

Same name and namespace in other branches
  1. 3.0.x tests/src/Functional/AgreementAnonymousTest.php \Drupal\Tests\agreement\Functional\AgreementAnonymousTest::testAgreement()

Tests agreement as anonymous user.

File

tests/src/Functional/AgreementAnonymousTest.php, line 27

Class

AgreementAnonymousTest
Tests agreement configured for anonymous user.

Namespace

Drupal\Tests\agreement\Functional

Code

public function testAgreement() {

  // Go to front page, no agreement.
  $this
    ->drupalGet('/node');
  $this
    ->assertNotAgreementPage($this->agreement);

  // Try submitting agreement form.
  $this
    ->assertNotAgreed($this->agreement);
  $this
    ->assertAgreed($this->agreement);
  $this
    ->assertSession()
    ->cookieEquals('agreement_anon_default', '1');
}