- $config = $this->spell->getConfig();
-
- $this->copyEvent();
- $config['spellcheck.limit'] = 6;
-
- $this->spell->onLoad();
- $this->plugin->onPrivMsg();
-
- $events = $this->getResponseEvents(Phergie_Event_Command::TYPE_PRIVMSG);
-
- $this->assertEquals(1, count($events));
- foreach ($events as $event) {
- $args = $event->getArguments();
-
- $this->assertEquals('#phergie', $args[0]);
-
- $this->assertContains('CheckSpellUser:', $args[1]);
- $this->assertRegExp('/([a-z]+, ){5}/', $args[1]);
- $this->assertContains('testz', $args[1]);
- $this->assertContains('test,', $args[1]);
- }
+ $this->setConfig('spellcheck.lang', 'en');
+ $this->plugin->onLoad();
+ $args = array(
+ 'receiver' => $this->source,
+ 'text' => 'spell ' . $word
+ );
+ $event = $this->getMockEvent('privmsg', $args);
+ $this->plugin->setEvent($event);