class UserMailDefaultsTest
Same name and namespace in other branches
- 11.x core/modules/user/tests/src/Kernel/UserMailDefaultsTest.php \Drupal\Tests\user\Kernel\UserMailDefaultsTest
- 10 core/modules/user/tests/src/Kernel/UserMailDefaultsTest.php \Drupal\Tests\user\Kernel\UserMailDefaultsTest
Tests that user.mail default settings are parsed correctly.
@group user
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\user\Kernel\UserMailDefaultsTest extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of UserMailDefaultsTest
File
-
core/
modules/ user/ tests/ src/ Kernel/ UserMailDefaultsTest.php, line 12
Namespace
Drupal\Tests\user\KernelView source
class UserMailDefaultsTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'user',
'system',
];
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this->installConfig([
'user',
]);
}
/**
* Tests that each user mail contains blank lines.
*
* @dataProvider userMailsProvider
*/
public function testMailDefaults($key) {
$body = $this->config('user.mail')
->get("{$key}.body");
$this->assertStringContainsString("\n\n", $body);
}
/**
* Data provider for user mail testing.
*
* @return array
* Array of arrays containing the set of user mail configuration keys.
*/
public function userMailsProvider() {
return [
[
'cancel_confirm',
],
[
'password_reset',
],
[
'status_activated',
],
[
'status_blocked',
],
[
'status_canceled',
],
[
'register_admin_created',
],
[
'register_no_approval_required',
],
[
'register_pending_approval',
],
[
'register_pending_approval_admin',
],
];
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.