You are here

public function GroupCreatorWizardTest::testCreatorMembershipWizard in Group 2.0.x

Same name and namespace in other branches
  1. 8 tests/src/Functional/GroupCreatorWizardTest.php \Drupal\Tests\group\Functional\GroupCreatorWizardTest::testCreatorMembershipWizard()

Tests that a group creator gets a membership using the wizard.

File

tests/src/Functional/GroupCreatorWizardTest.php, line 15

Class

GroupCreatorWizardTest
Tests the group creator wizard.

Namespace

Drupal\Tests\group\Functional

Code

public function testCreatorMembershipWizard() {
  $this
    ->drupalGet('/group/add/default');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $submit_button = 'Create Default label and complete your membership';
  $this
    ->assertSession()
    ->buttonExists($submit_button);
  $this
    ->assertSession()
    ->buttonExists('Cancel');
  $edit = [
    'Title' => $this
      ->randomString(),
  ];
  $this
    ->submitForm($edit, $submit_button);
  $submit_button = 'Save group and membership';
  $this
    ->assertSession()
    ->buttonExists($submit_button);
  $this
    ->assertSession()
    ->buttonExists('Back');
}