/** * @covers WindowsAzure\Blob\Models\CreateBlobSnapshotResult::getETag * @covers WindowsAzure\Blob\Models\CreateBlobSnapshotResult::setETag */ public function testSetETag() { $createBlobSnapshotResult = new CreateBlobSnapshotResult(); $expected = "12345678"; $createBlobSnapshotResult->setETag($expected); $this->assertEquals($expected, $createBlobSnapshotResult->getETag()); }
/** * Creates CreateBlobSnapshotResult object from the response of the * create Blob snapshot request. * * @param array $headers The HTTP response headers in array representation. * * @return CreateBlobSnapshotResult */ public static function create($headers) { $result = new CreateBlobSnapshotResult(); $headerWithLowerCaseKey = array_change_key_case($headers); $result->setETag($headerWithLowerCaseKey[Resources::ETAG]); $result->setLastModified(Utilities::rfc1123ToDateTime($headerWithLowerCaseKey[Resources::LAST_MODIFIED])); $result->setSnapshot($headerWithLowerCaseKey[Resources::X_MS_SNAPSHOT]); return $result; }