You are here

protected function AvatarKitWebTestBase::createAvatarGenerator in Avatar Kit 8

Creates an avatar generator plugin instance.

Parameters

array $values: Extra values for entity creation.

Return value

\Drupal\avatars\AvatarGeneratorInterface An avatar generator plugin instance.

4 calls to AvatarKitWebTestBase::createAvatarGenerator()
AvatarKitAdminSettingsTest::testAdminSettings in tests/src/Functional/AvatarKitAdminSettingsTest.php
Test admin settings.
AvatarKitAdminSettingsTest::testGeneratorDelete in tests/src/Functional/AvatarKitAdminSettingsTest.php
Test delete avatar generator config.
AvatarKitAdminSettingsTest::testGeneratorEdit in tests/src/Functional/AvatarKitAdminSettingsTest.php
Test edit avatar generator config.
AvatarKitGeneratorTest::testGenerator in tests/src/Functional/AvatarKitGeneratorTest.php
Test avatar generators.

File

tests/src/Functional/AvatarKitWebTestBase.php, line 55

Class

AvatarKitWebTestBase
Avatar Kit web test base.

Namespace

Drupal\Tests\avatars\Functional

Code

protected function createAvatarGenerator(array $values = []) {
  $avatar_generator = $this->avatarGeneratorStorage
    ->create($values + [
    'id' => mb_strtolower($this
      ->randomMachineName()),
    'label' => $this
      ->randomString(),
    'plugin' => 'avatars_test_dynamic',
  ]);
  $avatar_generator
    ->save();
  return $avatar_generator;
}