class HookEventDispatcherManagerTest in Hook Event Dispatcher 3.x
Same name and namespace in other branches
- 8.2 tests/src/Unit/Manager/HookEventDispatcherManagerTest.php \Drupal\Tests\hook_event_dispatcher\Unit\Manager\HookEventDispatcherManagerTest
- 8 tests/src/Unit/Manager/HookEventDispatcherManagerTest.php \Drupal\Tests\hook_event_dispatcher\Unit\Manager\HookEventDispatcherManagerTest
Class HookEventDispatcherManagerTest.
@package Drupal\Tests\hook_event_dispatcher\Unit\Manager
@group hook_event_dispatcher
Hierarchy
- class \Drupal\Tests\hook_event_dispatcher\Unit\Manager\HookEventDispatcherManagerTest extends \PHPUnit\Framework\TestCase
Expanded class hierarchy of HookEventDispatcherManagerTest
File
- tests/
src/ Unit/ Manager/ HookEventDispatcherManagerTest.php, line 16
Namespace
Drupal\Tests\hook_event_dispatcher\Unit\ManagerView source
class HookEventDispatcherManagerTest extends TestCase {
/**
* Test event dispatcher.
*/
public function testEventDispatcher() : void {
$event = new FakeEvent('test');
$dispatcher = $this
->createMock(EventDispatcherInterface::class);
$dispatcher
->method('dispatch')
->with('test', $event)
->willReturn($event);
$manager = new HookEventDispatcherManager($dispatcher);
$returnedEvent = $manager
->register($event);
self::assertSame($event, $returnedEvent);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HookEventDispatcherManagerTest:: |
public | function | Test event dispatcher. |