You are here

public function UserTest::testAnonymousEdit in Profile 8

Tests that a profile belonging to an anonymous user can be edited.

File

tests/src/Functional/UserTest.php, line 262

Class

UserTest
Tests the user pages.

Namespace

Drupal\Tests\profile\Functional

Code

public function testAnonymousEdit() {
  $profile = $this
    ->createProfile($this->type, User::getAnonymousUser());
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet($profile
    ->toUrl('edit-form'));
  $profile_fullname = $this
    ->randomString();
  $edit = [
    'profile_fullname[0][value]' => $profile_fullname,
  ];
  $this
    ->submitForm($edit, 'Save');
  $this
    ->assertSession()
    ->addressEquals($profile
    ->toUrl('collection'));
}