You are here

public function AgreementTestBase::assertAgreementPage in Agreement 3.0.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/AgreementTestBase.php \Drupal\Tests\agreement\Functional\AgreementTestBase::assertAgreementPage()

Assert that the current page is the agreement page.

Parameters

\Drupal\agreement\Entity\Agreement $agreement: The agreement entity to assert.

Throws

\Behat\Mink\Exception\ExpectationException

12 calls to AgreementTestBase::assertAgreementPage()
AgreementAccessDeniedRedirectTest::testAccessDeniedRedirect in tests/src/Functional/AgreementAccessDeniedRedirectTest.php
Asserts that the page is reached.
AgreementCustomFrequencyTest::testAgreement in tests/src/Functional/AgreementCustomFrequencyTest.php
Asserts agreement functionality.
AgreementCustomUnprivilegedUserTest::testAgreementDestination in tests/src/Functional/AgreementCustomUnprivilegedUserTest.php
Tests the agreement destination functionality.
AgreementCustomUnprivilegedUserTest::testAgreementFrequency in tests/src/Functional/AgreementCustomUnprivilegedUserTest.php
Asserts the agreement frequency option.
AgreementCustomUnprivilegedUserTest::testAgreementPages in tests/src/Functional/AgreementCustomUnprivilegedUserTest.php
Asserts that agreement only functions on the front page.

... See full list

File

tests/src/Functional/AgreementTestBase.php, line 148

Class

AgreementTestBase
Tests the agreement functionality.

Namespace

Drupal\Tests\agreement\Functional

Code

public function assertAgreementPage(Agreement $agreement) {
  $settings = $agreement
    ->getSettings();
  $this
    ->assertStringEndsWith($agreement
    ->get('path'), $this
    ->getUrl(), 'URL is agreement page.');
  $this
    ->assertSession()
    ->titleEquals($settings['title'] . ' | Drupal');
  $this
    ->assertSession()
    ->pageTextContains($settings['checkbox']);
}