예제 #1
0
 /**
  * @expectedException \Stomp\Exception\StompException
  */
 public function testWaitForReceiptWillThrowExceptionOnIdMissmatch()
 {
     $receiptFrame = new Frame('RECEIPT');
     $receiptFrame->setHeader('receipt-id', 'not-matching-id');
     $stomp = $this->getStompWithInjectedMockedConnectionReadResult($receiptFrame);
     $waitForReceipt = new ReflectionMethod($stomp, 'waitForReceipt');
     $waitForReceipt->setAccessible(true);
     // expect a receipt for another id
     $waitForReceipt->invoke($stomp, 'your-id');
 }
예제 #2
0
파일: Stomp.php 프로젝트: phpwutz/stomp-php
 /**
  * Write frame to server and expect an matching receipt frame
  *
  * @param Frame $stompFrame
  * @return bool
  */
 protected function sendFrameExpectingReceipt(Frame $stompFrame)
 {
     $receipt = md5(microtime());
     $stompFrame->setHeader('receipt', $receipt);
     $this->connection->writeFrame($stompFrame);
     return $this->waitForReceipt($receipt);
 }