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