/** * Tests run() with a subclass of AbstractPlugin included in the plugins * list to verify that default plugin processors work. */ public function testRunWithDefaultPluginProcessors() { $plugin = Phake::mock('\\Phergie\\Irc\\Bot\\React\\AbstractPlugin'); Phake::when($plugin)->getSubscribedEvents()->thenReturn(array('foo' => 'setLogger')); $connection = $this->getMockConnection(); $logger = $this->getMockLogger(); $client = $this->getMockClient(); $factory = $this->getMockEventQueueFactory(); $loop = Phake::mock('\\React\\EventLoop\\LoopInterface'); Phake::when($client)->getLogger()->thenReturn($logger); Phake::when($client)->getLoop()->thenReturn($loop); $config = array('plugins' => array($plugin), 'connections' => array($connection)); $this->bot->setClient($client); $this->bot->setConfig($config); $this->bot->setLogger($logger); $this->bot->setEventQueueFactory($factory); $this->bot->run(); Phake::verify($plugin)->setEventEmitter($client); Phake::verify($plugin)->setClient($client); Phake::verify($plugin)->setEventQueueFactory($factory); Phake::verify($plugin)->setLogger($logger); Phake::verify($plugin)->setLoop($loop); }