DigestTestBase.php in Message Digest 8
File
tests/src/Kernel/DigestTestBase.php
View source
<?php
namespace Drupal\Tests\message_digest\Kernel;
use Drupal\Core\Test\AssertMailTrait;
use Drupal\KernelTests\KernelTestBase;
use Drupal\Tests\message\Kernel\MessageTemplateCreateTrait;
use Drupal\Tests\user\Traits\UserCreationTrait;
abstract class DigestTestBase extends KernelTestBase {
use AssertMailTrait;
use MessageTemplateCreateTrait;
use UserCreationTrait;
public static $modules = [
'filter',
'filter_test',
'message',
'message_digest',
'message_digest_test',
'message_notify',
'system',
'user',
];
protected $notifierManager;
protected $notifierSender;
protected $digestManager;
public function setUp() {
parent::setUp();
$this->notifierManager = $this->container
->get('plugin.message_notify.notifier.manager');
$this->notifierSender = $this->container
->get('message_notify.sender');
$this->digestManager = $this->container
->get('message_digest.manager');
$this
->installEntitySchema('message');
$this
->installEntitySchema('user');
$this
->installSchema('message_digest', [
'message_digest',
]);
$this
->installSchema('system', [
'sequences',
]);
$this
->installSchema('user', [
'users_data',
]);
$this
->installConfig([
'filter',
'filter_test',
'message_digest',
'message_notify',
'system',
]);
$this
->createUser();
}
protected function sendDigests() {
$this->digestManager
->processDigests();
$this->container
->get('cron')
->run();
}
}
Classes
Name |
Description |
DigestTestBase |
Base class for kernel tests for the message digest module. |