/** * @depends testCancelEvent */ public function testPriorityOnce() { $argResult = 0; $eManager = new EventManager(); $eManager->once('foo', function () use(&$argResult) { $argResult = 1; throw new ExceptionStop('Something wrong #1'); }, EventManager::HIGH)->once('foo', function () use(&$argResult) { $argResult = 2; throw new ExceptionStop('Something wrong #2'); }, EventManager::HIGHEST); is('Something wrong #2', $eManager->trigger('foo', array('bar'))); is(2, $argResult); }