protected function ConfigUpdateUnitTestBase::getEventDispatcherMock in Configuration Update Manager 8
Mocks the event dispatcher service.
Stores dispatched events in ConfigUpdateUnitTestBase::dispatchedEvents.
1 call to ConfigUpdateUnitTestBase::getEventDispatcherMock()
- ConfigReverterTest::setUp in tests/
src/ Unit/ ConfigReverterTest.php
File
- tests/
src/ Unit/ ConfigUpdateUnitTestBase.php, line 332
Class
- ConfigUpdateUnitTestBase
- Base class for unit testing in Config Update Manager.
Namespace
Drupal\Tests\config_update\UnitCode
protected function getEventDispatcherMock() {
$event = $this
->getMockBuilder('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface')
->getMock();
$event
->method('dispatch')
->will($this
->returnCallback([
$this,
'mockDispatch',
]));
return $event;
}