You are here

public function RegistrationTest::testRegistration in Legal 2.0.x

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

Test registration with default Legal seetings.

File

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

Class

RegistrationTest
Tests a user creating an account.

Namespace

Drupal\Tests\legal\Functional

Code

public function testRegistration() {

  // Test with default Legal settings.
  $edit = [
    'mail' => 'roy@example.com',
    'name' => 'Roy Batty',
    'pass[pass1]' => 'xyz',
    'pass[pass2]' => 'xyz',
    'legal_accept' => TRUE,
  ];

  // Register user.
  $this
    ->drupalPostForm('user/register', $edit, 'Create new account');

  // Check for success message.
  $this
    ->assertText('Registration successful. You are now logged in.');
}