public function AgreementAnonymousTest::testAgreement in Agreement 8.2
Same name and namespace in other branches
- 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\FunctionalCode
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');
}