AgreementAnonymousTest.php in Agreement 3.0.x
File
tests/src/Functional/AgreementAnonymousTest.php
View source
<?php
namespace Drupal\Tests\agreement\Functional;
class AgreementAnonymousTest extends AgreementTestBase {
protected function setUp() : void {
parent::setUp();
$settings = $this->agreement
->getSettings();
$settings['roles'][] = 'anonymous';
$this->agreement
->set('settings', $settings);
$this->agreement
->save();
}
public function testAgreement() {
$this
->drupalGet('/node');
$this
->assertNotAgreementPage($this->agreement);
$this
->assertNotAgreed($this->agreement);
$this
->assertAgreed($this->agreement);
$this
->assertSession()
->cookieEquals('agreement_anon_default', '1');
}
}