function RulesKernelTestBase::setUp

Overrides KernelTestBase::setUp

13 calls to RulesKernelTestBase::setUp()
AutocompleteTest::setUp in tests/src/Kernel/Engine/AutocompleteTest.php
ConfigEntityDefaultsTest::setUp in tests/src/Kernel/ConfigEntityDefaultsTest.php
ConfigEntityTest::setUp in tests/src/Kernel/ConfigEntityTest.php
ConfigSchemaTest::setUp in tests/src/Kernel/ConfigSchemaTest.php
ConfigurableEventHandlerTest::setUp in tests/src/Kernel/ConfigurableEventHandlerTest.php

... See full list

13 methods override RulesKernelTestBase::setUp()
AutocompleteTest::setUp in tests/src/Kernel/Engine/AutocompleteTest.php
ConfigEntityDefaultsTest::setUp in tests/src/Kernel/ConfigEntityDefaultsTest.php
ConfigEntityTest::setUp in tests/src/Kernel/ConfigEntityTest.php
ConfigSchemaTest::setUp in tests/src/Kernel/ConfigSchemaTest.php
ConfigurableEventHandlerTest::setUp in tests/src/Kernel/ConfigurableEventHandlerTest.php

... See full list

File

tests/src/Kernel/RulesKernelTestBase.php, line 75

Class

RulesKernelTestBase
Base class for Rules Drupal unit tests.

Namespace

Drupal\Tests\rules\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    $this->logger = $this->container
        ->get('logger.channel.rules_debug');
    $this->debugLog = $this->container
        ->get('logger.rules_debug_log');
    // Turn on debug logging, set error level to collect only errors. This way
    // we can ignore the normal Rules debug messages that would otherwise get
    // in the way of our tests.
    $config = $this->container
        ->get('config.factory')
        ->getEditable('rules.settings');
    $config->set('debug_log.enabled', TRUE)
        ->set('debug_log.log_level', 'error')
        ->save();
    $this->expressionManager = $this->container
        ->get('plugin.manager.rules_expression');
    $this->conditionManager = $this->container
        ->get('plugin.manager.condition');
    $this->typedDataManager = $this->container
        ->get('typed_data_manager');
    $this->messenger = $this->container
        ->get('messenger');
    $this->time = $this->container
        ->get('datetime.time');
}