/**
  * Tests that messages that match the expected phrase will return as expected
  *
  * @param string $nick
  * @param string $source
  * @param string $message
  * @param string $expected
  *
  * @test
  * @dataProvider phraseProvider
  */
 public function userEventWithCorrectPhraseTriggersResponse($nick, $source, $message, $expected)
 {
     $event = $this->getMockBuilder('Phergie\\Irc\\Event\\UserEvent')->getMock();
     $event->expects($this->atLeastOnce())->method('getNick')->willReturn($nick);
     $event->expects($this->atLeastOnce())->method('getSource')->willReturn($source);
     $event->expects($this->atLeastOnce())->method('getParams')->willReturn(['text' => $message]);
     $response = 'Yes';
     $this->provider->expects($this->once())->method('getAnswer')->willReturn($response);
     $queue = $this->getMockBuilder('Phergie\\Irc\\Bot\\React\\EventQueueInterface')->getMock();
     $queue->expects($this->once())->method('ircPrivmsg')->with($source, $expected);
     $this->plugin->handleEvent($event, $queue);
 }
 /**
  * Returns a random, er clairvoyant answer to a given question
  *
  * @return string
  */
 public function getMagicEightBallAnswer()
 {
     return $this->provider->getAnswer();
 }