public function RegistrationTest::testRegistration in Legal 2.0.x
Same name and namespace in other branches
- 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\FunctionalCode
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.');
}