/**
  * Creates PeekMessagesResult object from parsed XML response.
  *
  * @param array $parsedResponse XML response parsed into array.
  * 
  * @return MicrosoftAzure\Storage\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 = MicrosoftAzureQueueMessage::createFromPeekMessages($value);
             $queueMessages[] = $message;
         }
     }
     $result->setQueueMessages($queueMessages);
     return $result;
 }
 /**
  * @covers MicrosoftAzure\Storage\Queue\Models\MicrosoftAzureQueueMessage::createFromPeekMessages
  */
 public function testCreateFromPeekMessages()
 {
     // Setup
     $sample = TestResources::listMessagesSample();
     $sample = $sample['QueueMessage'];
     // Test
     $actual = MicrosoftAzureQueueMessage::createFromPeekMessages($sample);
     // Assert
     $this->assertEquals($sample['MessageId'], $actual->getMessageId());
     $this->assertEquals(Utilities::rfc1123ToDateTime($sample['InsertionTime']), $actual->getInsertionDate());
     $this->assertEquals(Utilities::rfc1123ToDateTime($sample['ExpirationTime']), $actual->getExpirationDate());
     $this->assertEquals(intval($sample['DequeueCount']), $actual->getDequeueCount());
     $this->assertEquals($sample['MessageText'], $actual->getMessageText());
 }