You are here

protected function RulesIntegrationTestBase::enableModule in Rules 8.3

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.

25 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
IpIsBannedTest::setUp in tests/src/Unit/Integration/Condition/IpIsBannedTest.php

... See full list

File

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

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;
  }
}