UserAdminSettingsFormTest.php

Same filename in other branches
  1. 8.9.x core/modules/user/tests/src/Kernel/UserAdminSettingsFormTest.php
  2. 10 core/modules/user/tests/src/Kernel/UserAdminSettingsFormTest.php
  3. 11.x core/modules/user/tests/src/Kernel/UserAdminSettingsFormTest.php

Namespace

Drupal\Tests\user\Kernel

File

core/modules/user/tests/src/Kernel/UserAdminSettingsFormTest.php

View source
<?php

namespace Drupal\Tests\user\Kernel;

use Drupal\KernelTests\ConfigFormTestBase;
use Drupal\user\AccountSettingsForm;

/**
 * Configuration object user.mail and user.settings save test.
 *
 * @group user
 */
class UserAdminSettingsFormTest extends ConfigFormTestBase {
    
    /**
     * {@inheritdoc}
     */
    protected static $modules = [
        'user',
        'system',
    ];
    
    /**
     * {@inheritdoc}
     */
    protected function setUp() : void {
        parent::setUp();
        $this->form = AccountSettingsForm::create($this->container);
        $this->values = [
            'anonymous' => [
                '#value' => $this->randomString(10),
                '#config_name' => 'user.settings',
                '#config_key' => 'anonymous',
            ],
            'user_mail_cancel_confirm_body' => [
                '#value' => $this->randomString(),
                '#config_name' => 'user.mail',
                '#config_key' => 'cancel_confirm.body',
            ],
            'user_mail_cancel_confirm_subject' => [
                '#value' => $this->randomString(20),
                '#config_name' => 'user.mail',
                '#config_key' => 'cancel_confirm.subject',
            ],
            'register_pending_approval_admin_body' => [
                '#value' => $this->randomString(),
                '#config_name' => 'user.mail',
                '#config_key' => 'register_pending_approval_admin.body',
            ],
            'register_pending_approval_admin_subject' => [
                '#value' => $this->randomString(20),
                '#config_name' => 'user.mail',
                '#config_key' => 'register_pending_approval_admin.subject',
            ],
        ];
    }

}

Classes

Title Deprecated Summary
UserAdminSettingsFormTest Configuration object user.mail and user.settings save test.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.