function RulesIntegrationTestBase::enableModule

Fakes the enabling of a module and adds its namespace for plugin loading.

This method allows plugins provided by a module to be discoverable.

Parameters

string $name: The name of the module that's going to be enabled.

array $namespaces: Map of the association between module's namespaces and filesystem paths.

26 calls to RulesIntegrationTestBase::enableModule()
AnnotationProcessingTest::setUp in tests/src/Unit/Integration/Engine/AnnotationProcessingTest.php
BanIpTest::setUp in tests/src/Unit/Integration/RulesAction/BanIpTest.php
ContributedPluginDiscoveryTest::setUp in tests/src/Unit/Integration/ContributedPluginDiscoveryTest.php
EntityPathAliasCreateTest::setUp in tests/src/Unit/Integration/RulesAction/EntityPathAliasCreateTest.php
EventPropertyAccessTest::setUp in tests/src/Unit/Integration/Event/EventPropertyAccessTest.php

... See full list

File

tests/src/Unit/Integration/RulesIntegrationTestBase.php, line 286

Class

RulesIntegrationTestBase
Base class for Rules integration tests.

Namespace

Drupal\Tests\rules\Unit\Integration

Code

protected function enableModule($name, array $namespaces = []) {
    $this->enabledModules[$name] = TRUE;
    if (empty($namespaces)) {
        $namespaces = [
            'Drupal\\' . $name => $this->root . '/' . $this->constructModulePath($name) . '/src',
        ];
    }
    foreach ($namespaces as $namespace => $path) {
        $this->namespaces[$namespace] = $path;
    }
}