getEventHandler() public method

Returns an event handler instance, creating it if it does not already exist and using a default class if none has been set.
public getEventHandler ( ) : Phergie_Event_Handler
return Phergie_Event_Handler
コード例 #1
0
ファイル: Abstract.php プロジェクト: hjr3/phergie
 /**
  * Gets the required class refences from Phergie_Bot.
  *
  * @param Phergie_Bot $bot     Current bot instance in use
  * @param array       $options Optional processor arguments
  *
  * @return void
  */
 public function __construct(Phergie_Bot $bot, array $options = array())
 {
     $this->driver = $bot->getDriver();
     $this->plugins = $bot->getPluginHandler();
     $this->connections = $bot->getConnectionHandler();
     $this->events = $bot->getEventHandler();
     $this->ui = $bot->getUi();
     $this->options = $options;
 }
コード例 #2
0
ファイル: BotTest.php プロジェクト: jellydoughnut/phergie
 /**
  * Tests that a custom event handler can be set.
  *
  * @return void
  */
 public function testSetEventHandler()
 {
     $events = $this->getMockEventHandler();
     $this->bot->setEventHandler($events);
     $this->assertSame($events, $this->bot->getEventHandler());
 }