/** * @covers MicrosoftAzure\Storage\Blob\Models\CreateBlobPagesResult::setETag * @covers MicrosoftAzure\Storage\Blob\Models\CreateBlobPagesResult::getETag */ public function testSetETag() { // Setup $expected = '0x8CAFB82EFF70C46'; $options = new CreateBlobPagesResult(); $options->setETag($expected); // Test $options->setETag($expected); // Assert $this->assertEquals($expected, $options->getETag()); }
/** * Creates CreateBlobPagesResult object from $parsed response in array * representation * * @param array $headers HTTP response headers * * @return CreateBlobPagesResult */ public static function create($headers) { $result = new CreateBlobPagesResult(); $clean = array_change_key_case($headers); $date = $clean[Resources::LAST_MODIFIED]; $date = Utilities::rfc1123ToDateTime($date); $result->setETag($clean[Resources::ETAG]); $result->setLastModified($date); $result->setContentMD5(Utilities::tryGetValue($clean, Resources::CONTENT_MD5)); $result->setSequenceNumber(intval(Utilities::tryGetValue($clean, Resources::X_MS_BLOB_SEQUENCE_NUMBER))); return $result; }