Beispiel #1
0
 /**
  * Creates PeekMessagesResult object from parsed XML response.
  *
  * @param array $parsedResponse XML response parsed into array.
  * 
  * @return WindowsAzure\Queue\Models\PeekMessagesResult.
  */
 public static function create($parsedResponse)
 {
     $result = new PeekMessagesResult();
     $queueMessages = array();
     if (!empty($parsedResponse)) {
         $rawMessages = Utilities::getArray($parsedResponse['QueueMessage']);
         foreach ($rawMessages as $value) {
             $message = WindowsAzureQueueMessage::createFromPeekMessages($value);
             $queueMessages[] = $message;
         }
     }
     $result->setQueueMessages($queueMessages);
     return $result;
 }
 /**
  * Creates WindowsAzureQueueMessage object from parsed XML response of
  * PeekMessages.
  *
  * @param array $parsedResponse XML response parsed into array.
  * 
  * @return WindowsAzure\Queue\Models\WindowsAzureQueueMessage.
  */
 public static function createFromPeekMessages($parsedResponse)
 {
     $msg = new WindowsAzureQueueMessage();
     $expirationDate = $parsedResponse['ExpirationTime'];
     $insertionDate = $parsedResponse['InsertionTime'];
     $msg->setDequeueCount(intval($parsedResponse['DequeueCount']));
     $date = Utilities::rfc1123ToDateTime($expirationDate);
     $msg->setExpirationDate($date);
     $date = Utilities::rfc1123ToDateTime($insertionDate);
     $msg->setInsertionDate($date);
     $msg->setMessageId($parsedResponse['MessageId']);
     $msg->setMessageText($parsedResponse['MessageText']);
     return $msg;
 }
 /**
  * @covers WindowsAzure\Queue\Models\WindowsAzureQueueMessage::setDequeueCount
  */
 public function testSetDequeueCount()
 {
     // Setup
     $azureQueueMessage = new WindowsAzureQueueMessage();
     $expected = 1;
     // Test
     $azureQueueMessage->setDequeueCount($expected);
     // Assert
     $actual = $azureQueueMessage->getDequeueCount();
     $this->assertEquals($expected, $actual);
 }
 /**
  * Get the raw body string for the job.
  *
  * @return string
  */
 public function getRawBody()
 {
     return $this->job->getMessageText();
 }