Example #1
0
 /**
  * @test
  */
 public function instantiates()
 {
     $msg = 'All your base are belong to us';
     $result = new Result(false, $msg);
     $this->assertSame($msg, $result->getResultMessage());
     $this->assertFalse($result->isSuccess());
 }
 /**
  * @test
  * @dataProvider provideResults
  */
 public function listensToResults(Result $result)
 {
     $self = $this;
     $message = $this->message;
     $this->output->expects($this->once())->method('writeln')->will($this->returnCallback(function ($output) use($self, $message, $result) {
         $successStr = $result->isSuccess() ? 'SUCCESS' : 'FAILURE';
         $self->assertContains($message->getUuid(), $output);
         $self->assertContains($message->getTopic(), $output);
         $self->assertContains($successStr, $output);
         $self->assertContains($result->getResultMessage(), $output);
     }));
     $event = new ResultEvent($result, $this->message);
     $this->ed->dispatch(Events::MESSAGE_AFTER_HANDLE, $event);
 }