You are here

public function AgreementMultilingualTest::assertAgreed in Agreement 8.2

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

Asserts that the user has agreed to the agreement.

Parameters

\Drupal\agreement\Entity\Agreement $agreement: The agreement to agree to.

Throws

\Behat\Mink\Exception\ResponseTextException

Overrides AgreementTestBase::assertAgreed

1 call to AgreementMultilingualTest::assertAgreed()
AgreementMultilingualTest::testMultilingualAgreement in tests/src/Functional/AgreementMultilingualTest.php
Asserts the text is changed to Spanish.

File

tests/src/Functional/AgreementMultilingualTest.php, line 118

Class

AgreementMultilingualTest
Tests translating agreement.

Namespace

Drupal\Tests\agreement\Functional

Code

public function assertAgreed(Agreement $agreement) {
  $this
    ->drupalPostForm($agreement
    ->get('path'), [
    'agree' => 1,
  ], 'Enviar');

  // Check for redirects. It's odd that drupalPostForm doesn't handle this but
  // drupalGet does.
  if ($this
    ->checkForMetaRefresh()) {
    $this->metaRefreshCount = 0;
  }
  $this
    ->assertSession()
    ->pageTextContains('Gracias por aceptar nuestro acuerdo.');
  $this
    ->assertNotAgreementPage($agreement);
}