MessageSubscribeTestBase.php in Message Subscribe 8
File
tests/src/Kernel/MessageSubscribeTestBase.php
View source
<?php
namespace Drupal\Tests\message_subscribe\Kernel;
use Drupal\KernelTests\KernelTestBase;
use Drupal\Tests\node\Traits\ContentTypeCreationTrait;
use Drupal\Tests\node\Traits\NodeCreationTrait;
use Drupal\Tests\user\Traits\UserCreationTrait;
use Drupal\Tests\message\Kernel\MessageTemplateCreateTrait;
abstract class MessageSubscribeTestBase extends KernelTestBase {
use ContentTypeCreationTrait;
use MessageTemplateCreateTrait;
use NodeCreationTrait;
use UserCreationTrait;
public static $modules = [
'field',
'filter',
'flag',
'message',
'message_notify',
'message_subscribe',
'node',
'system',
'text',
'user',
];
protected $messageSubscribers;
protected $template;
public function setUp() {
parent::setUp();
$this
->installSchema('system', [
'sequences',
]);
$this
->installSchema('flag', [
'flag_counts',
]);
$this
->installEntitySchema('flagging');
$this
->installEntitySchema('message');
$this
->installEntitySchema('node');
$this
->installEntitySchema('user');
$this
->installConfig([
'field',
'filter',
'node',
'message_subscribe',
]);
$this->template = $this
->createMessageTemplate(mb_strtolower($this
->randomMachineName()), $this
->randomString(), $this
->randomString(), [
$this
->randomString(),
]);
}
}