- $this->setPlugin(new Phergie_Plugin_TerryChay());
- $config = new Phergie_Config();
- $handler = new Phergie_Plugin_Handler($config, $this->handler);
- $this->plugin->setPluginHandler($handler);
- $handler->addPlugin($this->plugin);
- $handler->addPlugin(new Phergie_Plugin_Http($config));
- $this->plugin->setConfig($config);
- $this->connection->setNick('phergie');
- $this->plugin->onLoad();
+ $response = $this->getMock('Phergie_Plugin_Http_Response');
+ $response
+ ->expects($this->any())
+ ->method('getContent')
+ ->will($this->returnValue($this->chayism));
+
+ $plugin = $this->getMock('Phergie_Plugin_Http');
+ $plugin
+ ->expects($this->any())
+ ->method('get')
+ ->will($this->returnValue($response));
+
+ $this->getMockPluginHandler()
+ ->expects($this->any())
+ ->method('getPlugin')
+ ->with('Http')
+ ->will($this->returnValue($plugin));