You are here

public function AvatarKitAdminSettingsTest::testGeneratorEdit in Avatar Kit 8

Test edit avatar generator config.

File

tests/src/Functional/AvatarKitAdminSettingsTest.php, line 71

Class

AvatarKitAdminSettingsTest
Avatar Kit admin settings test.

Namespace

Drupal\Tests\avatars\Functional

Code

public function testGeneratorEdit() {
  $avatar_generator = $this
    ->createAvatarGenerator();
  $this
    ->drupalGet($avatar_generator
    ->toUrl('edit-form'));
  $this
    ->assertResponse(200);
  $t_args = [
    '%label' => $avatar_generator
      ->label(),
  ];
  $this
    ->assertRaw(t('Edit avatar generator %label', $t_args));
  $edit = [
    'label' => $avatar_generator
      ->label(),
  ];
  $this
    ->drupalPostForm($avatar_generator
    ->toUrl('edit-form'), $edit, t('Save'));
  $this
    ->assertUrl('admin/config/people/avatars');
  $this
    ->assertRaw(t('Updated avatar generator %label', $t_args));
}