public function AgreementMultilingualTest::testMultilingualAgreement in Agreement 8.2
Same name and namespace in other branches
- 3.0.x tests/src/Functional/AgreementMultilingualTest.php \Drupal\Tests\agreement\Functional\AgreementMultilingualTest::testMultilingualAgreement()
Asserts the text is changed to Spanish.
File
- tests/
src/ Functional/ AgreementMultilingualTest.php, line 93
Class
- AgreementMultilingualTest
- Tests translating agreement.
Namespace
Drupal\Tests\agreement\FunctionalCode
public function testMultilingualAgreement() {
$this
->drupalLogin($this->spanishSpeaker);
// Sent to agreement page.
$this
->assertStringEndsWith($this->agreement
->get('path'), $this
->getUrl(), 'URL is agreement page.');
// Found agreement text in Spanish.
$this
->assertSession()
->titleEquals('Nuestro acuerdo | Drupal');
$this
->assertSession()
->pageTextContains('Nuestro acuerdo');
$this
->assertSession()
->checkboxNotChecked('Estoy de acuerdo.');
$this
->assertSession()
->buttonExists('Enviar');
$this
->assertSession()
->pageTextContainsOnce('Este es el texto del acuerdo.');
$this
->assertNotAgreed($this->agreement);
$this
->assertAgreed($this->agreement);
}