/** * Tests that a plugin can be associated with an event. * * @return void */ public function testSetPlugin() { $plugin = $this->getMock('Phergie_Plugin_Abstract'); $this->event->setPlugin($plugin); $this->assertSame($plugin, $this->event->getPlugin()); }
/** * Assert that the emitter of the given command event was the given * plugin * * @param Phergie_Event_Command $event * @param Phergie_Plugin_Abstract $plugin * @param string $message */ public function assertEventEmitter(Phergie_Event_Command $event, Phergie_Plugin_Abstract $plugin, $message = null) { $this->assertSame($plugin, $event->getPlugin(), $message); }
/** * Outputs a prompt when the bot sends a command to a server. * * @param Phergie_Event_Command $event Event representing the * command being sent * @param Phergie_Connection $connection Connection on which the * command is being sent * * @return void */ public function onCommand(Phergie_Event_Command $event, Phergie_Connection $connection) { $plugin = $event->getPlugin()->getName(); $host = $connection->getHostmask()->getHost(); $type = strtoupper($event->getType()); $args = implode(' ', $event->getArguments()); $this->console($plugin . ' plugin: ' . $host . ' -> ' . $type . ' ' . $args); }