You are here

protected function EventTestBase::setUp in Radioactivity 8.3

Same name and namespace in other branches
  1. 4.0.x tests/src/Unit/EventTestBase.php \Drupal\Tests\radioactivity\Unit\EventTestBase::setUp()

Overrides EventTestBase::setUp

File

tests/src/Unit/EventTestBase.php, line 20

Class

EventTestBase
Base class containing common code for radioactivity event tests.

Namespace

Drupal\Tests\radioactivity\Unit

Code

protected function setUp() : void {
  parent::setUp();

  // Must enable our module to make our plugins discoverable.
  $this
    ->enableModule('radioactivity', [
    'Drupal\\radioactivity' => __DIR__ . '/../../../src',
  ]);

  // Tell the plugin manager where to look for plugins.
  $this->moduleHandler
    ->getModuleDirectories()
    ->willReturn([
    'radioactivity' => __DIR__ . '/../../../',
  ]);

  // Create a real plugin manager with a mock moduleHandler.
  $this->eventManager = new RulesEventManager($this->moduleHandler
    ->reveal(), $this->entityTypeBundleInfo
    ->reveal());
}