public beforeDispatch ( Cake\Event\Event $event ) : void | ||
$event | Cake\Event\Event | The beforeDispatch event. |
Результат | void |
public function beforeDispatch(Event $event)
{
foreach ($this->_registry->loaded() as $panel) {
$this->_registry->{$panel}->initialize();
}
}
/** * Test that beforeDispatch call initialize on each panel * * @return void */ public function testBeforeDispatch() { $bar = new DebugBarFilter($this->events, []); $bar->setup(); $this->assertNull(Log::config('debug_kit_log_panel')); $event = new Event('Dispatcher.beforeDispatch'); $bar->beforeDispatch($event); $this->assertNotEmpty(Log::config('debug_kit_log_panel'), 'Panel attached logger.'); }