You are here

public function WebformElementEventTest::setUp in Hook Event Dispatcher 8

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. 3.x modules/webform_event_dispatcher/tests/src/Unit/WebformElement/WebformElementEventTest.php \Drupal\Tests\webform_event_dispatcher\Unit\WebformElement\WebformElementEventTest::setUp()

Overrides UnitTestCase::setUp

File

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

Class

WebformElementEventTest
Class WebformElementEventTest.

Namespace

Drupal\Tests\webform_event_dispatcher\Unit\WebformElement

Code

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