You are here

public function WebformElementEventTest::setUp in Hook Event Dispatcher 3.x

Same name and namespace in other branches
  1. 8.2 modules/webform_event_dispatcher/tests/src/Unit/WebformElement/WebformElementEventTest.php \Drupal\Tests\webform_event_dispatcher\Unit\WebformElement\WebformElementEventTest::setUp()
  2. 8 modules/webform_event_dispatcher/tests/src/Unit/WebformElement/WebformElementEventTest.php \Drupal\Tests\webform_event_dispatcher\Unit\WebformElement\WebformElementEventTest::setUp()

File

modules/webform_event_dispatcher/tests/src/Unit/WebformElement/WebformElementEventTest.php, line 33

Class

WebformElementEventTest
Class WebformElementEventTest.

Namespace

Drupal\Tests\webform_event_dispatcher\Unit\WebformElement

Code

public function setUp() : void {
  $builder = new ContainerBuilder();
  $this->manager = new HookEventDispatcherManagerSpy();
  $this->manager
    ->setMaxEventCount(2);
  $builder
    ->set('hook_event_dispatcher.manager', $this->manager);
  $builder
    ->compile();
  Drupal::setContainer($builder);
}