You are here

public function RegistrationTest::testHtml in Legal 2.0.x

Same name and namespace in other branches
  1. 8 tests/src/Functional/RegistrationTest.php \Drupal\Tests\legal\Functional\RegistrationTest::testHtml()

Test if T&Cs displays as HTML correctly.

File

tests/src/Functional/RegistrationTest.php, line 97

Class

RegistrationTest
Tests a user creating an account.

Namespace

Drupal\Tests\legal\Functional

Code

public function testHtml() {

  // Set conditions to display in an un-editable HTML text area.
  $this
    ->config('legal.settings')
    ->set('registration_terms_style', 2)
    ->set('registration_container', 0)
    ->save();

  // Go to registration page.
  $this
    ->drupalGet('user/register');

  // Check T&Cs displayed as HTML.
  $this
    ->assertSession()
    ->elementContains('css', '#user-register-form > div.legal-terms', $this->conditions);
}