Пример #1
0
 /**
  * {@inheritdoc}
  */
 protected function flush(AdapterInterface $adapter)
 {
     if (!empty($this->messages)) {
         $adapter->acknowledge($this->messages);
         $this->messages = [];
     }
 }
 public function testCustomResultAcknowledgementHandler()
 {
     $handler = new ResultAcknowledgementHandler(function ($result) {
         return $result === false;
     }, $this->handler);
     $this->message->shouldReceive('isValid')->once()->withNoArgs()->andReturn(true);
     $this->adapter->shouldReceive('acknowledge')->once()->with(m::mustBe([$this->message]));
     $handler($this->messages, $this->adapter, function ($msg) {
         return false;
     });
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 protected function acknowledge(MessageInterface $message, AdapterInterface $adapter, $result = null)
 {
     $adapter->acknowledge([$message]);
 }