function RulesEmailTest::setUp

Overrides RulesKernelTestBase::setUp

File

tests/src/Kernel/RulesEmailTest.php, line 27

Class

RulesEmailTest
Tests that emails actually go out with the send email action.

Namespace

Drupal\Tests\rules\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    // Use the state system collector email backend.
    $this->container
        ->get('config.factory')
        ->getEditable('system.mail')
        ->set('interface.default', 'test_mail_collector')
        ->save();
    // Reset the state variable that holds sent messages.
    $this->container
        ->get('state')
        ->set('system.test_mail_collector', []);
    $this->actionManager = $this->container
        ->get('plugin.manager.rules_action');
}