function SystemSendEmailTest::setUp

Overrides RulesIntegrationTestBase::setUp

File

tests/src/Unit/Integration/RulesAction/SystemSendEmailTest.php, line 37

Class

SystemSendEmailTest
@coversDefaultClass \Drupal\rules\Plugin\RulesAction\SystemSendEmail @group RulesAction

Namespace

Drupal\Tests\rules\Unit\Integration\RulesAction

Code

protected function setUp() : void {
    parent::setUp();
    $this->mailManager = $this->prophesize(MailManagerInterface::class);
    $this->container
        ->set('plugin.manager.mail', $this->mailManager
        ->reveal());
    // Mock the logger.factory service, make it return the Rules logger channel,
    // and register it in the container.
    $this->logger = $this->prophesize(LoggerChannelInterface::class);
    $logger_factory = $this->prophesize(LoggerChannelFactoryInterface::class);
    $logger_factory->get('rules')
        ->willReturn($this->logger
        ->reveal());
    $this->container
        ->set('logger.factory', $logger_factory->reveal());
    $this->action = $this->actionManager
        ->createInstance('rules_send_email');
}