Exemple #1
0
 public function testDescribeMultipleSnapshots()
 {
     $rawHttpResponse = "HTTP/1.1 200 OK\r\n" . "Date: Fri, 24 Oct 2008 17:24:52 GMT\r\n" . "Server: hi\r\n" . "Last-modified: Fri, 24 Oct 2008 17:24:52 GMT\r\n" . "Status: 200 OK\r\n" . "Content-type: application/xml; charset=utf-8\r\n" . "Expires: Tue, 31 Mar 1981 05:00:00 GMT\r\n" . "Connection: close\r\n" . "\r\n" . "<DescribeSnapshotsResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\r\n" . "  <snapshotSet>\r\n" . "    <item>\r\n" . "      <snapshotId>snap-78a54011</snapshotId>\r\n" . "      <volumeId>vol-4d826724</volumeId>\r\n" . "      <status>pending</status>\r\n" . "      <startTime>2008-05-07T12:51:50.000Z</startTime>\r\n" . "      <progress>80%</progress>\r\n" . "    </item>\r\n" . "    <item>\r\n" . "      <snapshotId>snap-78a54012</snapshotId>\r\n" . "      <volumeId>vol-4d826725</volumeId>\r\n" . "      <status>pending</status>\r\n" . "      <startTime>2008-08-07T12:51:50.000Z</startTime>\r\n" . "      <progress>65%</progress>\r\n" . "    </item>\r\n" . "  </snapshotSet>\r\n" . "</DescribeSnapshotsResponse>";
     $this->httpClientTestAdapter->setResponse($rawHttpResponse);
     $return = $this->ebsInstance->describeSnapshot(array('snap-78a54011', 'snap-78a54012'));
     $arrSnapshots = array(array('snapshotId' => 'snap-78a54011', 'volumeId' => 'vol-4d826724', 'status' => 'pending', 'startTime' => '2008-05-07T12:51:50.000Z', 'progress' => '80%'), array('snapshotId' => 'snap-78a54012', 'volumeId' => 'vol-4d826725', 'status' => 'pending', 'startTime' => '2008-08-07T12:51:50.000Z', 'progress' => '65%'));
     $this->assertSame($arrSnapshots, $return);
 }