final class CronEventTest in Hook Event Dispatcher 8.2
Same name and namespace in other branches
- 3.x modules/core_event_dispatcher/tests/src/Unit/Core/CronEventTest.php \Drupal\Tests\core_event_dispatcher\Unit\Core\CronEventTest
Class CronEventTest.
@group hook_event_dispatcher
Hierarchy
- class \Drupal\Tests\core_event_dispatcher\Unit\Core\CronEventTest extends \PHPUnit\Framework\TestCase
Expanded class hierarchy of CronEventTest
File
- modules/
core_event_dispatcher/ tests/ src/ Unit/ Core/ CronEventTest.php, line 18
Namespace
Drupal\Tests\core_event_dispatcher\Unit\CoreView source
final class CronEventTest extends TestCase {
/**
* HookEventDispatcherManagerSpy.
*
* @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 cron event.
*/
public function testCronEvent() : void {
core_event_dispatcher_cron();
$event = $this->manager
->getRegisteredEvent(HookEventDispatcherInterface::CRON);
self::assertInstanceOf(CronEvent::class, $event);
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CronEventTest:: |
private | property | HookEventDispatcherManagerSpy. | |
CronEventTest:: |
public | function | ||
CronEventTest:: |
public | function | Test the cron event. |