AgreementRevokeTest.php in Agreement 3.0.x
File
tests/src/Functional/AgreementRevokeTest.php
View source
<?php
namespace Drupal\Tests\agreement\Functional;
class AgreementRevokeTest extends AgreementTestBase {
public function testAgreement() {
$account = $this
->createRevokeUser();
$this
->drupalLogin($account);
$this
->assertAgreed($this->agreement);
$this
->assertNotAgreementPage($this->agreement);
$settings = $this->agreement
->getSettings();
$edit = [
'agree' => '0',
];
$this
->drupalGet('/agreement');
$this
->submitForm($edit, $settings['submit']);
$this
->assertSession()
->pageTextContains('You have successfully revoked your acceptance of our agreement. ');
$this
->drupalGet('/node/' . $this->node
->id());
$this
->assertAgreementPage($this->agreement);
$this
->assertAgreed($this->agreement);
$this
->assertNotAgreementPage($this->agreement);
}
}