function RulesDebugLoggerChannelTest::setUp

Overrides UnitTestCase::setUp

File

tests/src/Unit/RulesDebugLoggerChannelTest.php, line 54

Class

RulesDebugLoggerChannelTest
@coversDefaultClass \Drupal\rules\Logger\RulesDebugLoggerChannel @group Rules

Namespace

Drupal\Tests\rules\Unit

Code

protected function setUp() : void {
    parent::setUp();
    $container = new ContainerBuilder();
    $this->rulesDebugLogger = $this->prophesize(LoggerChannelInterface::class)
        ->reveal();
    $container->set('logger.channel.rules_debug', $this->rulesDebugLogger);
    $this->session = new TestSession();
    $container->set('session', $this->session);
    $this->rulesDebugLog = new RulesDebugLog($this->session);
    $container->set('logger.rules_debug_log', $this->rulesDebugLog);
    \Drupal::setContainer($container);
    $this->container = $container;
}