/** * Creates an event using ACSF defaults. * * @param string $type * The type of event to execute. * @param array $context * A custom context to pass to event handlers. */ public static function create($type, array $context = array()) { $registry = acsf_get_registry(); $event = new static(new AcsfEventDispatcher(), new AcsfLog(), $type, $registry, $context); return $event; }
/** * Tests that incompatible handler types may not be used. * * @expectedException \Acquia\Acsf\AcsfEventHandlerIncompatibleException */ public function testAcsfEventHandlerIncompatibleType() { $registry = acsf_get_registry(FALSE, 'UnitTestDummyHandler1'); $event = new \Acquia\Acsf\AcsfEvent(new \Acquia\Acsf\AcsfEventDispatcher(), new \Acquia\Acsf\AcsfLog(), 'unit_test', $registry, array()); // Pass in a bogus handler type to trigger an exception. $event->popHandler('bogus_type'); }