You are here

public function AvatarKitAdminSettingsTest::testGeneratorDelete in Avatar Kit 8

Test delete avatar generator config.

File

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

Class

AvatarKitAdminSettingsTest
Avatar Kit admin settings test.

Namespace

Drupal\Tests\avatars\Functional

Code

public function testGeneratorDelete() {
  $avatar_generator = $this
    ->createAvatarGenerator();
  $this
    ->drupalGet($avatar_generator
    ->toUrl('delete-form'));
  $this
    ->assertResponse(200);
  $t_args = [
    '%label' => $avatar_generator
      ->label(),
  ];
  $this
    ->assertRaw(t('Are you sure you want to delete avatar generator %label?', $t_args));
  $this
    ->drupalPostForm($avatar_generator
    ->toUrl('delete-form'), [], t('Delete'));
  $this
    ->assertUrl('admin/config/people/avatars');
  $this
    ->assertRaw(t('Avatar generator %label was deleted.', $t_args));
}