/** * @covers MicrosoftAzure\Storage\Blob\Models\CreateBlobPagesResult::setLastModified * @covers MicrosoftAzure\Storage\Blob\Models\CreateBlobPagesResult::getLastModified */ public function testSetLastModified() { // Setup $expected = Utilities::rfc1123ToDateTime('Sun, 25 Sep 2011 19:42:18 GMT'); $options = new CreateBlobPagesResult(); $options->setLastModified($expected); // Test $options->setLastModified($expected); // Assert $this->assertEquals($expected, $options->getLastModified()); }
/** * 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; }