Exemplo n.º 1
0
 public function testPublish()
 {
     $process = $this->createProcessMock();
     $this->processSerializer->expects($this->once())->method('serialize')->with($this->identicalTo($process))->will($this->returnValue($serialized = 'serialized'));
     $this->processProducer->expects($this->once())->method('publish')->with($this->identicalTo($serialized));
     $this->producer->publish($process);
 }
Exemplo n.º 2
0
 public function testExecute()
 {
     $message = $this->createAmqpMessageMock();
     $message->body = $body = '{"foo":"bar"}';
     $this->serializer->expects($this->once())->method('deserialize')->with($this->identicalTo($body))->will($this->returnValue($process = $this->createProcessMock()));
     $this->runner->expects($this->once())->method('run')->with($this->identicalTo($process));
     $this->consumer->execute($message);
 }