class ToolbarEventTest in Hook Event Dispatcher 3.x
Same name and namespace in other branches
- 8.2 modules/toolbar_event_dispatcher/tests/src/Unit/Toolbar/ToolbarEventTest.php \Drupal\Tests\toolbar_event_dispatcher\Unit\Toolbar\ToolbarEventTest
Class ToolbarEventTest.
@group toolbar_event_dispatcher
Hierarchy
- class \Drupal\Tests\toolbar_event_dispatcher\Unit\Toolbar\ToolbarEventTest extends \PHPUnit\Framework\TestCase
Expanded class hierarchy of ToolbarEventTest
File
- modules/
toolbar_event_dispatcher/ tests/ src/ Unit/ Toolbar/ ToolbarEventTest.php, line 18
Namespace
Drupal\Tests\toolbar_event_dispatcher\Unit\ToolbarView source
class ToolbarEventTest extends TestCase {
/**
* The manager.
*
* @var \Drupal\Tests\hook_event_dispatcher\Unit\HookEventDispatcherManagerSpy
*/
private $manager;
/**
* {@inheritdoc}
*/
public function setUp() : void {
$builder = new ContainerBuilder();
$this->manager = new HookEventDispatcherManagerSpy();
$builder
->set('hook_event_dispatcher.manager', $this->manager);
$builder
->compile();
Drupal::setContainer($builder);
}
/**
* Test the ToolbarAlterEvent.
*/
public function testToolbarEvent() : void {
toolbar_event_dispatcher_toolbar();
$event = $this->manager
->getRegisteredEvent(HookEventDispatcherInterface::TOOLBAR);
self::assertInstanceOf(ToolbarEvent::class, $event);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ToolbarEventTest:: |
private | property | The manager. | |
ToolbarEventTest:: |
public | function | ||
ToolbarEventTest:: |
public | function | Test the ToolbarAlterEvent. |