From 02fe11be4a2b3d3838fb1fc7f25d1065784f00f1 Mon Sep 17 00:00:00 2001 From: z38 Date: Mon, 18 Sep 2017 14:14:50 +0200 Subject: [PATCH 01/11] Fix formatting of non-UTC dates --- src/Common/Internal/Utilities.php | 20 ++++---------------- src/Common/SharedAccessSignatureHelper.php | 8 ++++---- tests/framework/TestResources.php | 12 ++++++------ tests/unit/Common/Internal/UtilitiesTest.php | 4 ++-- tests/unit/Table/Models/EntityTest.php | 2 +- 5 files changed, 17 insertions(+), 29 deletions(-) diff --git a/src/Common/Internal/Utilities.php b/src/Common/Internal/Utilities.php index d2690297a..9ebd8bae9 100644 --- a/src/Common/Internal/Utilities.php +++ b/src/Common/Internal/Utilities.php @@ -368,27 +368,15 @@ public static function rfc1123ToDateTime($date) /** * Generate ISO 8601 compliant date string in UTC time zone * - * @param int $timestamp The unix timestamp to convert - * (for DateTime check date_timestamp_get). + * @param \DateTimeInterface $date The date value to convert * * @return string */ - public static function isoDate($timestamp = null) + public static function isoDate(\DateTimeInterface $date) { - $tz = date_default_timezone_get(); - date_default_timezone_set('UTC'); + $date = (clone $date)->setTimezone(new \DateTimeZone('UTC')); - if (is_null($timestamp)) { - $timestamp = time(); - } - - $returnValue = str_replace( - '+00:00', - '.0000000Z', - date('c', $timestamp) - ); - date_default_timezone_set($tz); - return $returnValue; + return str_replace('+00:00', 'Z', $date->format('c')); } /** diff --git a/src/Common/SharedAccessSignatureHelper.php b/src/Common/SharedAccessSignatureHelper.php index 92776c376..c02131ad0 100644 --- a/src/Common/SharedAccessSignatureHelper.php +++ b/src/Common/SharedAccessSignatureHelper.php @@ -127,14 +127,14 @@ private function generateServiceSharedAccessSignatureToken( ); // check that expiracy is valid if ($signedExpiry instanceof \Datetime) { - $signedExpiry = $signedExpiry->format('Y-m-d\TH:i:s\Z'); + $signedExpiry = Utilities::isoDate($signedExpiry); } Validate::notNullOrEmpty($signedExpiry, 'signedExpiry'); Validate::canCastAsString($signedExpiry, 'signedExpiry'); Validate::isDateString($signedExpiry, 'signedExpiry'); // check that signed start is valid if ($signedStart instanceof \Datetime) { - $signedStart = $signedStart->format('Y-m-d\TH:i:s\Z'); + $signedStart = Utilities::isoDate($signedStart); } Validate::canCastAsString($signedStart, 'signedStart'); if (strlen($signedStart) > 0) { @@ -560,7 +560,7 @@ public function generateAccountSharedAccessSignatureToken( // check that expiracy is valid if ($signedExpiry instanceof \Datetime) { - $signedExpiry = $signedExpiry->format('Y-m-d\TH:i:s\Z'); + $signedExpiry = Utilities::isoDate($signedExpiry); } Validate::canCastAsString($signedExpiry, 'signedExpiry'); Validate::notNullOrEmpty($signedExpiry, 'signedExpiry'); @@ -568,7 +568,7 @@ public function generateAccountSharedAccessSignatureToken( // check that signed start is valid if ($signedStart instanceof \Datetime) { - $signedStart = $signedStart->format('Y-m-d\TH:i:s\Z'); + $signedStart = Utilities::isoDate($signedStart); } Validate::canCastAsString($signedStart, 'signedStart'); if (strlen($signedStart) > 0) { diff --git a/tests/framework/TestResources.php b/tests/framework/TestResources.php index 35fc3e506..3a9a1729d 100644 --- a/tests/framework/TestResources.php +++ b/tests/framework/TestResources.php @@ -1502,7 +1502,7 @@ public static function getInterestingAccountSASTestCase( $signedIP = "" ) { if ($signedExpiry == "") { - $signedExpiry = (self::getRandomLaterTime()->format('Y-m-d\TH:i:s\Z')); + $signedExpiry = Utilities::isoDate(self::getRandomLaterTime()); } if ($signedStart == "") { @@ -1540,7 +1540,7 @@ public static function getInterestingBlobOrFileSASTestCase( $contentType = "" ) { if ($signedExpiry == "") { - $signedExpiry = (self::getRandomLaterTime()->format('Y-m-d\TH:i:s\Z')); + $signedExpiry = Utilities::isoDate(self::getRandomLaterTime()); } if ($signedStart == "") { @@ -1581,11 +1581,11 @@ public static function getInterestingTableSASTestCase( $endingRowKey = "" ) { if ($signedExpiry == "") { - $signedExpiry = (self::getRandomLaterTime()->format('Y-m-d\TH:i:s\Z')); + $signedExpiry = Utilities::isoDate(self::getRandomLaterTime()); } if ($signedStart == "") { - $signedStart = (self::getRandomEarlierTime()->format('Y-m-d\TH:i:s\Z')); + $signedStart = Utilities::isoDate(self::getRandomEarlierTime()); } if ($signedIP == "") { @@ -1616,11 +1616,11 @@ public static function getInterestingQueueSASTestCase( $signedIP = "" ) { if ($signedExpiry == "") { - $signedExpiry = (self::getRandomLaterTime()->format('Y-m-d\TH:i:s\Z')); + $signedExpiry = Utilities::isoDate(self::getRandomLaterTime()); } if ($signedStart == "") { - $signedStart = (self::getRandomEarlierTime()->format('Y-m-d\TH:i:s\Z')); + $signedStart = Utilities::isoDate(self::getRandomEarlierTime()); } if ($signedIP == "") { diff --git a/tests/unit/Common/Internal/UtilitiesTest.php b/tests/unit/Common/Internal/UtilitiesTest.php index bc73820e2..39a5a62f9 100644 --- a/tests/unit/Common/Internal/UtilitiesTest.php +++ b/tests/unit/Common/Internal/UtilitiesTest.php @@ -332,10 +332,10 @@ public function testBooleanToString() public function testIsoDate() { // Test - $date = Utilities::isoDate(); + $date = Utilities::isoDate(new \DateTimeImmutable('2016-02-03', new \DateTimeZone('America/Chicago'))); // Assert - $this->assertNotNull($date); + $this->assertSame('2016-02-03T06:00:00Z', $date); } /** diff --git a/tests/unit/Table/Models/EntityTest.php b/tests/unit/Table/Models/EntityTest.php index a3c46d028..c60c598e0 100644 --- a/tests/unit/Table/Models/EntityTest.php +++ b/tests/unit/Table/Models/EntityTest.php @@ -122,7 +122,7 @@ public function testSetTimestamp() { // Setup $entity = new Entity(); - $expected = Utilities::convertToDateTime(Utilities::isoDate()); + $expected = new \DateTime(); // Test $entity->setTimestamp($expected); From 80336280425082490b9326b4dfba9405097e12f7 Mon Sep 17 00:00:00 2001 From: z38 Date: Wed, 20 Sep 2017 07:31:18 +0200 Subject: [PATCH 02/11] Fix namespaces of test classes (#103) 4 original commits included: Rename namespaces of test classes; Fix namespaces of test classes; Fix names of ACL classes; Fix filename of LeaseResultTest. * Fix namespaces of test classes * Fix names of ACL classes * Fix filename of LeaseResultTest --- CONTRIBUTING.md | 2 +- phpunit.functional.xml.dist | 2 +- phpunit.xml.dist | 2 +- samples/BlobSamples.php | 4 +- src/Blob/Models/ContainerACL.php | 2 +- src/Blob/Models/GetContainerACLResult.php | 2 +- ...areAclResult.php => GetShareACLResult.php} | 0 .../BlobServiceRestProxyTestBase.php | 2 +- .../FileServiceRestProxyTestBase.php | 2 +- .../QueueServiceRestProxyTestBase.php | 2 +- .../ReflectionTestBase.php | 2 +- .../RestProxyTestBase.php | 2 +- .../SASFunctionalTestBase.php | 4 +- .../ServiceRestProxyTestBase.php | 2 +- .../TableServiceRestProxyTestBase.php | 2 +- .../TestResources.php | 2 +- .../VirtualFileSystem.php | 2 +- .../Blob/BlobServiceFunctionalTest.php | 2 +- .../Blob/BlobServiceFunctionalTestData.php | 14 +++--- .../Blob/BlobServiceIntegrationTest.php | 2 +- .../Blob/FunctionalTestBase.php | 2 +- .../Blob/IntegrationTestBase.php | 2 +- .../Common/AccountSASFunctionalTest.php | 8 ++-- .../Common/AnonymousAccessFunctionalTest.php | 4 +- .../Common/ServiceSASFunctionalTest.php | 8 ++-- .../SharedAccessSignatureHelperMock.php | 2 +- .../File/FileServiceFunctionalTest.php | 2 +- .../File/FileServiceFunctionalTestData.php | 8 ++-- .../File/FunctionalTestBase.php | 2 +- .../File/IntegrationTestBase.php | 2 +- .../Queue/FunctionalTestBase.php | 2 +- .../Queue/IntegrationTestBase.php | 2 +- .../QueueServiceFunctionalOptionsTest.php | 2 +- .../QueueServiceFunctionalParameterTest.php | 2 +- .../Queue/QueueServiceFunctionalTest.php | 2 +- .../Queue/QueueServiceFunctionalTestData.php | 2 +- .../Queue/QueueServiceIntegrationTest.php | 2 +- .../Table/Enums/ConcurType.php | 2 +- .../Table/Enums/MutatePivot.php | 2 +- .../Table/Enums/OpType.php | 2 +- .../Table/FunctionalTestBase.php | 2 +- .../Table/IntegrationTestBase.php | 2 +- .../Table/Models/BatchWorkerConfig.php | 2 +- .../Table/Models/FakeTableInfoEntry.php | 2 +- .../TableServiceFunctionalOptionsTest.php | 2 +- .../TableServiceFunctionalParametersTest.php | 2 +- .../Table/TableServiceFunctionalQueryTest.php | 2 +- .../Table/TableServiceFunctionalTest.php | 2 +- .../Table/TableServiceFunctionalTestData.php | 2 +- .../Table/TableServiceFunctionalTestUtils.php | 2 +- .../Table/TableServiceIntegrationTest.php | 2 +- .../Authentication/OAuthSchemeMock.php | 2 +- .../SharedAccessSignatureAuthSchemeMock.php | 2 +- .../SharedKeyAuthSchemeMock.php | 2 +- .../TableSharedKeyLiteAuthSchemeMock.php | 2 +- .../{unit => Unit}/Blob/BlobRestProxyTest.php | 6 +-- .../Blob/Models/AccessConditionTest.php | 2 +- .../Blob/Models/BlobBlockTypeTest.php | 2 +- .../Blob/Models/BlobPrefixTest.php | 2 +- .../Blob/Models/BlobPropertiesTest.php | 2 +- tests/{unit => Unit}/Blob/Models/BlobTest.php | 2 +- .../Blob/Models/BlobTypeTest.php | 2 +- .../Blob/Models/BlockListTest.php | 2 +- .../{unit => Unit}/Blob/Models/BlockTest.php | 2 +- .../Blob/Models/BreakLeaseResultTest.php | 2 +- .../Models/CommitBlobBlocksOptionsTest.php | 2 +- .../Blob/Models/ContainerACLTest.php | 46 +++++++++---------- .../Blob/Models/ContainerPropertiesTest.php | 2 +- .../Blob/Models/ContainerTest.php | 2 +- .../Blob/Models/CopyBlobOptionsTest.php | 2 +- .../Blob/Models/CopyBlobResultTest.php | 2 +- .../Models/CreateBlobBlockOptionsTest.php | 2 +- .../Blob/Models/CreateBlobOptionsTest.php | 2 +- .../Models/CreateBlobPagesOptionsTest.php | 2 +- .../Blob/Models/CreateBlobPagesResultTest.php | 2 +- .../Models/CreateBlobSnapshotOptionsTest.php | 2 +- .../Models/CreateBlobSnapshotResultTest.php | 2 +- .../Models/CreateContainerOptionsTest.php | 2 +- .../Blob/Models/DeleteBlobOptionsTest.php | 2 +- .../Models/GetBlobMetadataOptionsTest.php | 2 +- .../Blob/Models/GetBlobMetadataResultTest.php | 2 +- .../Blob/Models/GetBlobOptionsTest.php | 2 +- .../Models/GetBlobPropertiesOptionsTest.php | 2 +- .../Models/GetBlobPropertiesResultTest.php | 2 +- .../Blob/Models/GetBlobResultTest.php | 2 +- .../Blob/Models/GetContainerACLResultTest.php | 2 +- .../GetContainerPropertiesResultTest.php | 2 +- .../Blob/Models/LeaseModeTest.php | 2 +- .../Blob/Models/LeaseResultTest.php} | 2 +- .../Blob/Models/ListBlobBlocksOptionsTest.php | 2 +- .../Blob/Models/ListBlobBlocksResultTest.php | 2 +- .../Blob/Models/ListBlobsOptionsTest.php | 2 +- .../Blob/Models/ListBlobsResultTest.php | 2 +- .../Blob/Models/ListContainersOptionsTest.php | 2 +- .../Blob/Models/ListContainersResultTest.php | 2 +- .../ListPageBlobRangesDiffResultTest.php | 2 +- .../Models/ListPageBlobRangesOptionsTest.php | 2 +- .../Models/ListPageBlobRangesResultTest.php | 2 +- .../Blob/Models/PublicAccessTypeTest.php | 2 +- .../Blob/Models/PutBlobResultTest.php | 2 +- .../Blob/Models/PutBlockResultTest.php | 2 +- .../Blob/Models/SetBlobMetadataResultTest.php | 2 +- .../Models/SetBlobPropertiesOptionsTest.php | 2 +- .../Models/SetBlobPropertiesResultTest.php | 2 +- .../Blob/Models/SignedIdentifierTest.php | 2 +- .../Common/CloudConfigurationManagerTest.php | 2 +- .../Exceptions/ServiceExceptionTest.php | 4 +- .../Common/Internal/ACLBaseTest.php | 2 +- .../SharedAccessSignatureAuthSchemeTest.php | 2 +- .../SharedKeyAuthSchemeTest.php | 2 +- .../TableSharedKeyLiteAuthSchemeTest.php | 2 +- .../Internal/ConnectionStringParserTest.php | 2 +- .../Internal/ConnectionStringSourceTest.php | 2 +- .../Internal/Http/HttpCallContextTest.php | 2 +- .../InvalidArgumentTypeExceptionTest.php | 2 +- .../Common/Internal/LoggerTest.php | 2 +- .../CommonRequestMiddlewareTest.php | 2 +- .../Internal/Serialization/DummyClass.php | 2 +- .../Serialization/JsonSerializerTest.php | 2 +- .../Serialization/XmlSerializerTest.php | 2 +- .../Common/Internal/ServiceOptionsTest.php | 2 +- .../Common/Internal/ServiceRestProxyTest.php | 2 +- .../Internal/StorageServiceSettingsTest.php | 2 +- .../Common/Internal/UtilitiesTest.php | 2 +- .../Common/Internal/ValidateTest.php | 2 +- .../Middlewares/HistoryMiddlewareTest.php | 2 +- .../Common/Middlewares/MiddlewareBaseTest.php | 2 +- .../Middlewares/MiddlewareStackTest.php | 2 +- .../RetryMiddlewareFactoryTest.php | 2 +- .../Common/Models/AccessPolicyTest.php | 4 +- .../{unit => Unit}/Common/Models/CORSTest.php | 2 +- .../Models/GetServicePropertiesResultTest.php | 2 +- .../Models/GetServiceStatsResultTest.php | 2 +- .../Common/Models/LoggingTest.php | 2 +- .../Common/Models/MetricsTest.php | 2 +- .../Common/Models/RangeDiffTest.php | 2 +- .../Common/Models/RangeTest.php | 2 +- .../Common/Models/RetentionPolicyTest.php | 2 +- .../Common/Models/ServicePropertiesTest.php | 2 +- .../Common/ServicesBuilderTest.php | 2 +- .../SharedAccessSignatureHelperTest.php | 4 +- .../{unit => Unit}/File/FileRestProxyTest.php | 4 +- .../File/Models/DirectoryTest.php | 2 +- tests/{unit => Unit}/File/Models/FileTest.php | 2 +- .../GetDirectoryPropertiesResultTest.php | 2 +- .../Models/GetSharePropertiesResultTest.php | 2 +- .../ListDirectoriesAndFilesResultTest.php | 2 +- .../File/Models/ListSharesResultTest.php | 2 +- .../File/Models/SharePropertiesTest.php | 4 +- .../{unit => Unit}/File/Models/ShareTest.php | 4 +- .../Queue/Models/CreateMessageOptionsTest.php | 2 +- .../Queue/Models/CreateQueueOptionsTest.php | 2 +- .../Models/GetQueueMetadataResultTest.php | 2 +- .../Queue/Models/ListMessagesOptionsTest.php | 2 +- .../Queue/Models/ListMessagesResultTest.php | 2 +- .../Queue/Models/ListQueuesOptionsTest.php | 2 +- .../Queue/Models/ListQueuesResultTest.php | 2 +- .../Queue/Models/PeekMessagesOptionsTest.php | 2 +- .../Queue/Models/PeekMessagesResultTest.php | 2 +- .../Queue/Models/QueueACLTest.php | 2 +- .../Queue/Models/QueueMessageTest.php | 2 +- .../{unit => Unit}/Queue/Models/QueueTest.php | 2 +- .../Queue/Models/UpdateMessageResultTest.php | 2 +- .../Queue/QueueRestProxyTest.php | 2 +- .../Internal/JsonODataReaderWriterTest.php | 0 .../BatchOperationParameterNameTest.php | 2 +- .../Table/Models/BatchOperationTest.php | 2 +- .../Table/Models/BatchOperationTypeTest.php | 2 +- .../Table/Models/BatchOperationsTest.php | 2 +- .../Table/Models/BatchResultTest.php | 2 +- .../Table/Models/DeleteEntityOptionsTest.php | 2 +- .../Table/Models/EdmTypeTest.php | 2 +- .../Table/Models/EntityTest.php | 2 +- .../Table/Models/Filters/BinaryFilterTest.php | 2 +- .../Models/Filters/ConstantFilterTest.php | 2 +- .../Table/Models/Filters/FilterTest.php | 2 +- .../Models/Filters/PropertyNameFilterTest.php | 2 +- .../Models/Filters/QueryStringFilterTest.php | 2 +- .../Table/Models/Filters/UnaryFilterTest.php | 2 +- .../Table/Models/GetEntityResultTest.php | 2 +- .../Table/Models/GetTableResultTest.php | 2 +- .../Table/Models/InsertEntityResultTest.php | 2 +- .../Table/Models/PropertyTest.php | 2 +- .../Table/Models/QueryEntitiesOptionsTest.php | 2 +- .../Table/Models/QueryEntitiesResultTest.php | 2 +- .../Table/Models/QueryTablesOptionsTest.php | 2 +- .../Table/Models/QueryTablesResultTest.php | 2 +- .../{unit => Unit}/Table/Models/QueryTest.php | 2 +- .../Table/Models/TableACLTest.php | 2 +- .../Table/Models/UpdateEntityResultTest.php | 2 +- .../Table/TableRestProxyTest.php | 0 191 files changed, 236 insertions(+), 236 deletions(-) rename src/File/Models/{GetShareAclResult.php => GetShareACLResult.php} (100%) rename tests/{framework => Framework}/BlobServiceRestProxyTestBase.php (99%) rename tests/{framework => Framework}/FileServiceRestProxyTestBase.php (99%) rename tests/{framework => Framework}/QueueServiceRestProxyTestBase.php (98%) rename tests/{framework => Framework}/ReflectionTestBase.php (96%) rename tests/{framework => Framework}/RestProxyTestBase.php (98%) rename tests/{framework => Framework}/SASFunctionalTestBase.php (99%) rename tests/{framework => Framework}/ServiceRestProxyTestBase.php (98%) rename tests/{framework => Framework}/TableServiceRestProxyTestBase.php (98%) rename tests/{framework => Framework}/TestResources.php (99%) rename tests/{framework => Framework}/VirtualFileSystem.php (97%) rename tests/{functional => Functional}/Blob/BlobServiceFunctionalTest.php (99%) rename tests/{functional => Functional}/Blob/BlobServiceFunctionalTestData.php (99%) rename tests/{functional => Functional}/Blob/BlobServiceIntegrationTest.php (99%) rename tests/{functional => Functional}/Blob/FunctionalTestBase.php (98%) rename tests/{functional => Functional}/Blob/IntegrationTestBase.php (97%) rename tests/{functional => Functional}/Common/AccountSASFunctionalTest.php (98%) rename tests/{functional => Functional}/Common/AnonymousAccessFunctionalTest.php (98%) rename tests/{functional => Functional}/Common/ServiceSASFunctionalTest.php (99%) rename tests/{functional => Functional}/Common/SharedAccessSignatureHelperMock.php (96%) rename tests/{functional => Functional}/File/FileServiceFunctionalTest.php (99%) rename tests/{functional => Functional}/File/FileServiceFunctionalTestData.php (99%) rename tests/{functional => Functional}/File/FunctionalTestBase.php (98%) rename tests/{functional => Functional}/File/IntegrationTestBase.php (97%) rename tests/{functional => Functional}/Queue/FunctionalTestBase.php (97%) rename tests/{functional => Functional}/Queue/IntegrationTestBase.php (96%) rename tests/{functional => Functional}/Queue/QueueServiceFunctionalOptionsTest.php (99%) rename tests/{functional => Functional}/Queue/QueueServiceFunctionalParameterTest.php (99%) rename tests/{functional => Functional}/Queue/QueueServiceFunctionalTest.php (99%) rename tests/{functional => Functional}/Queue/QueueServiceFunctionalTestData.php (99%) rename tests/{functional => Functional}/Queue/QueueServiceIntegrationTest.php (99%) rename tests/{functional => Functional}/Table/Enums/ConcurType.php (95%) rename tests/{functional => Functional}/Table/Enums/MutatePivot.php (95%) rename tests/{functional => Functional}/Table/Enums/OpType.php (95%) rename tests/{functional => Functional}/Table/FunctionalTestBase.php (98%) rename tests/{functional => Functional}/Table/IntegrationTestBase.php (96%) rename tests/{functional => Functional}/Table/Models/BatchWorkerConfig.php (94%) rename tests/{functional => Functional}/Table/Models/FakeTableInfoEntry.php (93%) rename tests/{functional => Functional}/Table/TableServiceFunctionalOptionsTest.php (99%) rename tests/{functional => Functional}/Table/TableServiceFunctionalParametersTest.php (99%) rename tests/{functional => Functional}/Table/TableServiceFunctionalQueryTest.php (99%) rename tests/{functional => Functional}/Table/TableServiceFunctionalTest.php (99%) rename tests/{functional => Functional}/Table/TableServiceFunctionalTestData.php (99%) rename tests/{functional => Functional}/Table/TableServiceFunctionalTestUtils.php (99%) rename tests/{functional => Functional}/Table/TableServiceIntegrationTest.php (99%) rename tests/{mock => Mock}/Common/Internal/Authentication/OAuthSchemeMock.php (96%) rename tests/{mock => Mock}/Common/Internal/Authentication/SharedAccessSignatureAuthSchemeMock.php (96%) rename tests/{mock => Mock}/Common/Internal/Authentication/SharedKeyAuthSchemeMock.php (97%) rename tests/{mock => Mock}/Common/Internal/Authentication/TableSharedKeyLiteAuthSchemeMock.php (96%) rename tests/{unit => Unit}/Blob/BlobRestProxyTest.php (99%) rename tests/{unit => Unit}/Blob/Models/AccessConditionTest.php (99%) rename tests/{unit => Unit}/Blob/Models/BlobBlockTypeTest.php (96%) rename tests/{unit => Unit}/Blob/Models/BlobPrefixTest.php (97%) rename tests/{unit => Unit}/Blob/Models/BlobPropertiesTest.php (99%) rename tests/{unit => Unit}/Blob/Models/BlobTest.php (98%) rename tests/{unit => Unit}/Blob/Models/BlobTypeTest.php (96%) rename tests/{unit => Unit}/Blob/Models/BlockListTest.php (99%) rename tests/{unit => Unit}/Blob/Models/BlockTest.php (97%) rename tests/{unit => Unit}/Blob/Models/BreakLeaseResultTest.php (97%) rename tests/{unit => Unit}/Blob/Models/CommitBlobBlocksOptionsTest.php (99%) rename tests/{unit => Unit}/Blob/Models/ContainerACLTest.php (70%) rename tests/{unit => Unit}/Blob/Models/ContainerPropertiesTest.php (98%) rename tests/{unit => Unit}/Blob/Models/ContainerTest.php (98%) rename tests/{unit => Unit}/Blob/Models/CopyBlobOptionsTest.php (98%) rename tests/{unit => Unit}/Blob/Models/CopyBlobResultTest.php (97%) rename tests/{unit => Unit}/Blob/Models/CreateBlobBlockOptionsTest.php (97%) rename tests/{unit => Unit}/Blob/Models/CreateBlobOptionsTest.php (99%) rename tests/{unit => Unit}/Blob/Models/CreateBlobPagesOptionsTest.php (98%) rename tests/{unit => Unit}/Blob/Models/CreateBlobPagesResultTest.php (98%) rename tests/{unit => Unit}/Blob/Models/CreateBlobSnapshotOptionsTest.php (97%) rename tests/{unit => Unit}/Blob/Models/CreateBlobSnapshotResultTest.php (97%) rename tests/{unit => Unit}/Blob/Models/CreateContainerOptionsTest.php (98%) rename tests/{unit => Unit}/Blob/Models/DeleteBlobOptionsTest.php (98%) rename tests/{unit => Unit}/Blob/Models/GetBlobMetadataOptionsTest.php (98%) rename tests/{unit => Unit}/Blob/Models/GetBlobMetadataResultTest.php (98%) rename tests/{unit => Unit}/Blob/Models/GetBlobOptionsTest.php (99%) rename tests/{unit => Unit}/Blob/Models/GetBlobPropertiesOptionsTest.php (98%) rename tests/{unit => Unit}/Blob/Models/GetBlobPropertiesResultTest.php (97%) rename tests/{unit => Unit}/Blob/Models/GetBlobResultTest.php (98%) rename tests/{unit => Unit}/Blob/Models/GetContainerACLResultTest.php (98%) rename tests/{unit => Unit}/Blob/Models/GetContainerPropertiesResultTest.php (98%) rename tests/{unit => Unit}/Blob/Models/LeaseModeTest.php (96%) rename tests/{unit/Blob/Models/LeaseBlobResultTest.php => Unit/Blob/Models/LeaseResultTest.php} (97%) rename tests/{unit => Unit}/Blob/Models/ListBlobBlocksOptionsTest.php (98%) rename tests/{unit => Unit}/Blob/Models/ListBlobBlocksResultTest.php (98%) rename tests/{unit => Unit}/Blob/Models/ListBlobsOptionsTest.php (99%) rename tests/{unit => Unit}/Blob/Models/ListBlobsResultTest.php (99%) rename tests/{unit => Unit}/Blob/Models/ListContainersOptionsTest.php (98%) rename tests/{unit => Unit}/Blob/Models/ListContainersResultTest.php (99%) rename tests/{unit => Unit}/Blob/Models/ListPageBlobRangesDiffResultTest.php (98%) rename tests/{unit => Unit}/Blob/Models/ListPageBlobRangesOptionsTest.php (98%) rename tests/{unit => Unit}/Blob/Models/ListPageBlobRangesResultTest.php (98%) rename tests/{unit => Unit}/Blob/Models/PublicAccessTypeTest.php (96%) rename tests/{unit => Unit}/Blob/Models/PutBlobResultTest.php (98%) rename tests/{unit => Unit}/Blob/Models/PutBlockResultTest.php (97%) rename tests/{unit => Unit}/Blob/Models/SetBlobMetadataResultTest.php (97%) rename tests/{unit => Unit}/Blob/Models/SetBlobPropertiesOptionsTest.php (99%) rename tests/{unit => Unit}/Blob/Models/SetBlobPropertiesResultTest.php (97%) rename tests/{unit => Unit}/Blob/Models/SignedIdentifierTest.php (98%) rename tests/{unit => Unit}/Common/CloudConfigurationManagerTest.php (99%) rename tests/{unit => Unit}/Common/Exceptions/ServiceExceptionTest.php (97%) rename tests/{unit => Unit}/Common/Internal/ACLBaseTest.php (99%) rename tests/{unit => Unit}/Common/Internal/Authentication/SharedAccessSignatureAuthSchemeTest.php (97%) rename tests/{unit => Unit}/Common/Internal/Authentication/SharedKeyAuthSchemeTest.php (99%) rename tests/{unit => Unit}/Common/Internal/Authentication/TableSharedKeyLiteAuthSchemeTest.php (98%) rename tests/{unit => Unit}/Common/Internal/ConnectionStringParserTest.php (99%) rename tests/{unit => Unit}/Common/Internal/ConnectionStringSourceTest.php (97%) rename tests/{unit => Unit}/Common/Internal/Http/HttpCallContextTest.php (99%) rename tests/{unit => Unit}/Common/Internal/InvalidArgumentTypeExceptionTest.php (96%) rename tests/{unit => Unit}/Common/Internal/LoggerTest.php (97%) rename tests/{unit => Unit}/Common/Internal/Middlewares/CommonRequestMiddlewareTest.php (98%) rename tests/{unit => Unit}/Common/Internal/Serialization/DummyClass.php (96%) rename tests/{unit => Unit}/Common/Internal/Serialization/JsonSerializerTest.php (98%) rename tests/{unit => Unit}/Common/Internal/Serialization/XmlSerializerTest.php (98%) rename tests/{unit => Unit}/Common/Internal/ServiceOptionsTest.php (97%) rename tests/{unit => Unit}/Common/Internal/ServiceRestProxyTest.php (99%) rename tests/{unit => Unit}/Common/Internal/StorageServiceSettingsTest.php (99%) rename tests/{unit => Unit}/Common/Internal/UtilitiesTest.php (99%) rename tests/{unit => Unit}/Common/Internal/ValidateTest.php (99%) rename tests/{unit => Unit}/Common/Middlewares/HistoryMiddlewareTest.php (98%) rename tests/{unit => Unit}/Common/Middlewares/MiddlewareBaseTest.php (98%) rename tests/{unit => Unit}/Common/Middlewares/MiddlewareStackTest.php (97%) rename tests/{unit => Unit}/Common/Middlewares/RetryMiddlewareFactoryTest.php (98%) rename tests/{unit => Unit}/Common/Models/AccessPolicyTest.php (98%) rename tests/{unit => Unit}/Common/Models/CORSTest.php (98%) rename tests/{unit => Unit}/Common/Models/GetServicePropertiesResultTest.php (97%) rename tests/{unit => Unit}/Common/Models/GetServiceStatsResultTest.php (97%) rename tests/{unit => Unit}/Common/Models/LoggingTest.php (99%) rename tests/{unit => Unit}/Common/Models/MetricsTest.php (99%) rename tests/{unit => Unit}/Common/Models/RangeDiffTest.php (97%) rename tests/{unit => Unit}/Common/Models/RangeTest.php (98%) rename tests/{unit => Unit}/Common/Models/RetentionPolicyTest.php (98%) rename tests/{unit => Unit}/Common/Models/ServicePropertiesTest.php (99%) rename tests/{unit => Unit}/Common/ServicesBuilderTest.php (99%) rename tests/{unit => Unit}/Common/SharedAccessSignatureHelperTest.php (98%) rename tests/{unit => Unit}/File/FileRestProxyTest.php (99%) rename tests/{unit => Unit}/File/Models/DirectoryTest.php (97%) rename tests/{unit => Unit}/File/Models/FileTest.php (97%) rename tests/{unit => Unit}/File/Models/GetDirectoryPropertiesResultTest.php (98%) rename tests/{unit => Unit}/File/Models/GetSharePropertiesResultTest.php (98%) rename tests/{unit => Unit}/File/Models/ListDirectoriesAndFilesResultTest.php (98%) rename tests/{unit => Unit}/File/Models/ListSharesResultTest.php (98%) rename tests/{unit => Unit}/File/Models/SharePropertiesTest.php (95%) rename tests/{unit => Unit}/File/Models/ShareTest.php (95%) rename tests/{unit => Unit}/Queue/Models/CreateMessageOptionsTest.php (98%) rename tests/{unit => Unit}/Queue/Models/CreateQueueOptionsTest.php (97%) rename tests/{unit => Unit}/Queue/Models/GetQueueMetadataResultTest.php (97%) rename tests/{unit => Unit}/Queue/Models/ListMessagesOptionsTest.php (98%) rename tests/{unit => Unit}/Queue/Models/ListMessagesResultTest.php (98%) rename tests/{unit => Unit}/Queue/Models/ListQueuesOptionsTest.php (98%) rename tests/{unit => Unit}/Queue/Models/ListQueuesResultTest.php (98%) rename tests/{unit => Unit}/Queue/Models/PeekMessagesOptionsTest.php (97%) rename tests/{unit => Unit}/Queue/Models/PeekMessagesResultTest.php (98%) rename tests/{unit => Unit}/Queue/Models/QueueACLTest.php (98%) rename tests/{unit => Unit}/Queue/Models/QueueMessageTest.php (99%) rename tests/{unit => Unit}/Queue/Models/QueueTest.php (98%) rename tests/{unit => Unit}/Queue/Models/UpdateMessageResultTest.php (97%) rename tests/{unit => Unit}/Queue/QueueRestProxyTest.php (99%) rename tests/{unit => Unit}/Table/Internal/JsonODataReaderWriterTest.php (100%) rename tests/{unit => Unit}/Table/Models/BatchOperationParameterNameTest.php (97%) rename tests/{unit => Unit}/Table/Models/BatchOperationTest.php (97%) rename tests/{unit => Unit}/Table/Models/BatchOperationTypeTest.php (97%) rename tests/{unit => Unit}/Table/Models/BatchOperationsTest.php (99%) rename tests/{unit => Unit}/Table/Models/BatchResultTest.php (97%) rename tests/{unit => Unit}/Table/Models/DeleteEntityOptionsTest.php (96%) rename tests/{unit => Unit}/Table/Models/EdmTypeTest.php (99%) rename tests/{unit => Unit}/Table/Models/EntityTest.php (99%) rename tests/{unit => Unit}/Table/Models/Filters/BinaryFilterTest.php (97%) rename tests/{unit => Unit}/Table/Models/Filters/ConstantFilterTest.php (97%) rename tests/{unit => Unit}/Table/Models/Filters/FilterTest.php (99%) rename tests/{unit => Unit}/Table/Models/Filters/PropertyNameFilterTest.php (96%) rename tests/{unit => Unit}/Table/Models/Filters/QueryStringFilterTest.php (96%) rename tests/{unit => Unit}/Table/Models/Filters/UnaryFilterTest.php (97%) rename tests/{unit => Unit}/Table/Models/GetEntityResultTest.php (97%) rename tests/{unit => Unit}/Table/Models/GetTableResultTest.php (97%) rename tests/{unit => Unit}/Table/Models/InsertEntityResultTest.php (97%) rename tests/{unit => Unit}/Table/Models/PropertyTest.php (97%) rename tests/{unit => Unit}/Table/Models/QueryEntitiesOptionsTest.php (98%) rename tests/{unit => Unit}/Table/Models/QueryEntitiesResultTest.php (97%) rename tests/{unit => Unit}/Table/Models/QueryTablesOptionsTest.php (98%) rename tests/{unit => Unit}/Table/Models/QueryTablesResultTest.php (97%) rename tests/{unit => Unit}/Table/Models/QueryTest.php (98%) rename tests/{unit => Unit}/Table/Models/TableACLTest.php (98%) rename tests/{unit => Unit}/Table/Models/UpdateEntityResultTest.php (97%) rename tests/{unit => Unit}/Table/TableRestProxyTest.php (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5f95d01a4..af62621ad 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -47,7 +47,7 @@ You can use the following commands to run tests: * One particular test case: ``phpunit -c phpunit.dist.xml --filter `` or ``phpunit -c phpunit.functional.dist.xml --filter `` ### Testing Features -As you develop a feature, you'll need to write tests to ensure quality. Your changes should be covered by both unit tests and functional tests. The unit tests and functional tests codes should be placed under tests/unit and tests/functional respectively. You should also run existing tests related to your change to address any unexpected breaks. +As you develop a feature, you'll need to write tests to ensure quality. Your changes should be covered by both unit tests and functional tests. The unit tests and functional tests codes should be placed under tests/Unit and tests/Functional respectively. You should also run existing tests related to your change to address any unexpected breaks. ## Pull Requests diff --git a/phpunit.functional.xml.dist b/phpunit.functional.xml.dist index 795e854b6..9d163c1d5 100644 --- a/phpunit.functional.xml.dist +++ b/phpunit.functional.xml.dist @@ -8,7 +8,7 @@ verbose="true"> - tests/functional/ + tests/Functional/ diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 84114134d..72fdd6c09 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,7 +8,7 @@ verbose="true"> - tests/unit + tests/Unit diff --git a/samples/BlobSamples.php b/samples/BlobSamples.php index 289493f07..459da31db 100644 --- a/samples/BlobSamples.php +++ b/samples/BlobSamples.php @@ -30,7 +30,7 @@ use MicrosoftAzure\Storage\Blob\Models\DeleteBlobOptions; use MicrosoftAzure\Storage\Blob\Models\CreateBlobOptions; use MicrosoftAzure\Storage\Blob\Models\GetBlobOptions; -use MicrosoftAzure\Storage\Blob\Models\ContainerAcl; +use MicrosoftAzure\Storage\Blob\Models\ContainerACL; use MicrosoftAzure\Storage\Blob\Models\SetBlobPropertiesOptions; use MicrosoftAzure\Storage\Blob\Models\ListPageBlobRangesOptions; use MicrosoftAzure\Storage\Common\Exceptions\ServiceException; @@ -234,7 +234,7 @@ function containerAcl($blobClient) // Set container ACL $past = new \DateTime("01/01/2010"); $future = new \DateTime("01/01/2020"); - $acl = new ContainerAcl(); + $acl = new ContainerACL(); $acl->setPublicAccess(PublicAccessType::CONTAINER_AND_BLOBS); $acl->addSignedIdentifier('123', $past, $future, 'rw'); $blobClient->setContainerACL($container, $acl); diff --git a/src/Blob/Models/ContainerACL.php b/src/Blob/Models/ContainerACL.php index da3eafe90..b07a4b884 100644 --- a/src/Blob/Models/ContainerACL.php +++ b/src/Blob/Models/ContainerACL.php @@ -68,7 +68,7 @@ public static function create($publicAccess, array $parsed = null) PublicAccessType::isValid($publicAccess), Resources::INVALID_BLOB_PAT_MSG ); - $result = new ContainerAcl(); + $result = new ContainerACL(); $result->fromXmlArray($parsed); $result->setPublicAccess($publicAccess); diff --git a/src/Blob/Models/GetContainerACLResult.php b/src/Blob/Models/GetContainerACLResult.php index fb74ffc53..250b0d8fc 100644 --- a/src/Blob/Models/GetContainerACLResult.php +++ b/src/Blob/Models/GetContainerACLResult.php @@ -63,7 +63,7 @@ public static function create( $result = new GetContainerAclResult(); $result->setETag($etag); $result->setLastModified($lastModified); - $acl = ContainerAcl::create($publicAccess, $parsed); + $acl = ContainerACL::create($publicAccess, $parsed); $result->setContainerAcl($acl); return $result; diff --git a/src/File/Models/GetShareAclResult.php b/src/File/Models/GetShareACLResult.php similarity index 100% rename from src/File/Models/GetShareAclResult.php rename to src/File/Models/GetShareACLResult.php diff --git a/tests/framework/BlobServiceRestProxyTestBase.php b/tests/Framework/BlobServiceRestProxyTestBase.php similarity index 99% rename from tests/framework/BlobServiceRestProxyTestBase.php rename to tests/Framework/BlobServiceRestProxyTestBase.php index 9ed5e9501..d2ab20ec8 100644 --- a/tests/framework/BlobServiceRestProxyTestBase.php +++ b/tests/Framework/BlobServiceRestProxyTestBase.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\framework; +namespace MicrosoftAzure\Storage\Tests\Framework; use MicrosoftAzure\Storage\Blob\Models\Container; use MicrosoftAzure\Storage\Tests\Framework\ServiceRestProxyTestBase; diff --git a/tests/framework/FileServiceRestProxyTestBase.php b/tests/Framework/FileServiceRestProxyTestBase.php similarity index 99% rename from tests/framework/FileServiceRestProxyTestBase.php rename to tests/Framework/FileServiceRestProxyTestBase.php index ed7db0805..2151e6ab2 100644 --- a/tests/framework/FileServiceRestProxyTestBase.php +++ b/tests/Framework/FileServiceRestProxyTestBase.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\framework; +namespace MicrosoftAzure\Storage\Tests\Framework; use MicrosoftAzure\Storage\Tests\Framework\ServiceRestProxyTestBase; use MicrosoftAzure\Storage\File\Models\CreateShareOptions; diff --git a/tests/framework/QueueServiceRestProxyTestBase.php b/tests/Framework/QueueServiceRestProxyTestBase.php similarity index 98% rename from tests/framework/QueueServiceRestProxyTestBase.php rename to tests/Framework/QueueServiceRestProxyTestBase.php index 2b50ac44a..41fc51239 100644 --- a/tests/framework/QueueServiceRestProxyTestBase.php +++ b/tests/Framework/QueueServiceRestProxyTestBase.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\framework; +namespace MicrosoftAzure\Storage\Tests\Framework; use MicrosoftAzure\Storage\Tests\Framework\ServiceRestProxyTestBase; use MicrosoftAzure\Storage\Common\Models\ServiceProperties; diff --git a/tests/framework/ReflectionTestBase.php b/tests/Framework/ReflectionTestBase.php similarity index 96% rename from tests/framework/ReflectionTestBase.php rename to tests/Framework/ReflectionTestBase.php index 6174c0978..9328ab247 100644 --- a/tests/framework/ReflectionTestBase.php +++ b/tests/Framework/ReflectionTestBase.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\framework; +namespace MicrosoftAzure\Storage\Tests\Framework; class ReflectionTestBase extends \PHPUnit_Framework_TestCase { diff --git a/tests/framework/RestProxyTestBase.php b/tests/Framework/RestProxyTestBase.php similarity index 98% rename from tests/framework/RestProxyTestBase.php rename to tests/Framework/RestProxyTestBase.php index 604d89fbb..356ea7bfa 100644 --- a/tests/framework/RestProxyTestBase.php +++ b/tests/Framework/RestProxyTestBase.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\framework; +namespace MicrosoftAzure\Storage\Tests\Framework; use MicrosoftAzure\Storage\Common\Logger; use MicrosoftAzure\Storage\Common\Internal\Serialization\XmlSerializer; diff --git a/tests/framework/SASFunctionalTestBase.php b/tests/Framework/SASFunctionalTestBase.php similarity index 99% rename from tests/framework/SASFunctionalTestBase.php rename to tests/Framework/SASFunctionalTestBase.php index be312dffd..a41ab4fbf 100644 --- a/tests/framework/SASFunctionalTestBase.php +++ b/tests/Framework/SASFunctionalTestBase.php @@ -22,14 +22,14 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\framework; +namespace MicrosoftAzure\Storage\Tests\Framework; use MicrosoftAzure\Storage\Common\ServicesBuilder; use MicrosoftAzure\Storage\Common\Internal\Serialization\XmlSerializer; use MicrosoftAzure\Storage\Common\Internal\Resources; use MicrosoftAzure\Storage\Common\Internal\StorageServiceSettings; use MicrosoftAzure\Storage\Common\SharedAccessSignatureHelper; -use MicrosoftAzure\Storage\Tests\framework\TestResources; +use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Exceptions\ServiceException; /** diff --git a/tests/framework/ServiceRestProxyTestBase.php b/tests/Framework/ServiceRestProxyTestBase.php similarity index 98% rename from tests/framework/ServiceRestProxyTestBase.php rename to tests/Framework/ServiceRestProxyTestBase.php index 623bfcf35..d6b292c66 100644 --- a/tests/framework/ServiceRestProxyTestBase.php +++ b/tests/Framework/ServiceRestProxyTestBase.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\framework; +namespace MicrosoftAzure\Storage\Tests\Framework; use MicrosoftAzure\Storage\Common\Internal\Resources; use MicrosoftAzure\Storage\Common\Models\ServiceProperties; diff --git a/tests/framework/TableServiceRestProxyTestBase.php b/tests/Framework/TableServiceRestProxyTestBase.php similarity index 98% rename from tests/framework/TableServiceRestProxyTestBase.php rename to tests/Framework/TableServiceRestProxyTestBase.php index 2c63aeb30..8e3681fb9 100644 --- a/tests/framework/TableServiceRestProxyTestBase.php +++ b/tests/Framework/TableServiceRestProxyTestBase.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\framework; +namespace MicrosoftAzure\Storage\Tests\Framework; use MicrosoftAzure\Storage\Tests\Framework\ServiceRestProxyTestBase; diff --git a/tests/framework/TestResources.php b/tests/Framework/TestResources.php similarity index 99% rename from tests/framework/TestResources.php rename to tests/Framework/TestResources.php index 3a9a1729d..a820d04bc 100644 --- a/tests/framework/TestResources.php +++ b/tests/Framework/TestResources.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\framework; +namespace MicrosoftAzure\Storage\Tests\Framework; use MicrosoftAzure\Storage\Table\Models\EdmType; use MicrosoftAzure\Storage\Table\Models\Entity; diff --git a/tests/framework/VirtualFileSystem.php b/tests/Framework/VirtualFileSystem.php similarity index 97% rename from tests/framework/VirtualFileSystem.php rename to tests/Framework/VirtualFileSystem.php index def7b8973..f7fce5ac8 100644 --- a/tests/framework/VirtualFileSystem.php +++ b/tests/Framework/VirtualFileSystem.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\framework; +namespace MicrosoftAzure\Storage\Tests\Framework; use org\bovigo\vfs\vfsStream; use org\bovigo\vfs\vfsStreamDirectory; diff --git a/tests/functional/Blob/BlobServiceFunctionalTest.php b/tests/Functional/Blob/BlobServiceFunctionalTest.php similarity index 99% rename from tests/functional/Blob/BlobServiceFunctionalTest.php rename to tests/Functional/Blob/BlobServiceFunctionalTest.php index 005158318..960142638 100644 --- a/tests/functional/Blob/BlobServiceFunctionalTest.php +++ b/tests/Functional/Blob/BlobServiceFunctionalTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Blob; +namespace MicrosoftAzure\Storage\Tests\Functional\Blob; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Blob\Models\BlobServiceOptions; diff --git a/tests/functional/Blob/BlobServiceFunctionalTestData.php b/tests/Functional/Blob/BlobServiceFunctionalTestData.php similarity index 99% rename from tests/functional/Blob/BlobServiceFunctionalTestData.php rename to tests/Functional/Blob/BlobServiceFunctionalTestData.php index c8052be1b..ca591ca4a 100644 --- a/tests/functional/Blob/BlobServiceFunctionalTestData.php +++ b/tests/Functional/Blob/BlobServiceFunctionalTestData.php @@ -22,11 +22,11 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Blob; +namespace MicrosoftAzure\Storage\Tests\Functional\Blob; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Blob\Models\AccessCondition; -use MicrosoftAzure\Storage\Blob\Models\ContainerAcl; +use MicrosoftAzure\Storage\Blob\Models\ContainerACL; use MicrosoftAzure\Storage\Blob\Models\CopyBlobOptions; use MicrosoftAzure\Storage\Blob\Models\BlobServiceOptions; use MicrosoftAzure\Storage\Blob\Models\CreateBlobOptions; @@ -750,22 +750,22 @@ public static function getInterestingACL() $past = new \DateTime("01/01/2010"); $future = new \DateTime("01/01/2020"); - $acl = new ContainerAcl(); + $acl = new ContainerACL(); array_push($ret, $acl); - $acl = new ContainerAcl(); + $acl = new ContainerACL(); $acl->setPublicAccess(PublicAccessType::NONE); array_push($ret, $acl); - $acl = new ContainerAcl(); + $acl = new ContainerACL(); $acl->setPublicAccess(PublicAccessType::BLOBS_ONLY); array_push($ret, $acl); - $acl = new ContainerAcl(); + $acl = new ContainerACL(); $acl->setPublicAccess(PublicAccessType::CONTAINER_AND_BLOBS); array_push($ret, $acl); - $acl = new ContainerAcl(); + $acl = new ContainerACL(); $acl->addSignedIdentifier('123', $past, $future, 'rw'); array_push($ret, $acl); diff --git a/tests/functional/Blob/BlobServiceIntegrationTest.php b/tests/Functional/Blob/BlobServiceIntegrationTest.php similarity index 99% rename from tests/functional/Blob/BlobServiceIntegrationTest.php rename to tests/Functional/Blob/BlobServiceIntegrationTest.php index c59cb89c2..b737522b2 100644 --- a/tests/functional/Blob/BlobServiceIntegrationTest.php +++ b/tests/Functional/Blob/BlobServiceIntegrationTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Blob; +namespace MicrosoftAzure\Storage\Tests\Functional\Blob; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Blob\Models\AccessCondition; diff --git a/tests/functional/Blob/FunctionalTestBase.php b/tests/Functional/Blob/FunctionalTestBase.php similarity index 98% rename from tests/functional/Blob/FunctionalTestBase.php rename to tests/Functional/Blob/FunctionalTestBase.php index 9ab0f1886..336b4c987 100644 --- a/tests/functional/Blob/FunctionalTestBase.php +++ b/tests/Functional/Blob/FunctionalTestBase.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Blob; +namespace MicrosoftAzure\Storage\Tests\Functional\Blob; use MicrosoftAzure\Storage\Common\Exceptions\ServiceException; use MicrosoftAzure\Storage\Common\Internal\StorageServiceSettings; diff --git a/tests/functional/Blob/IntegrationTestBase.php b/tests/Functional/Blob/IntegrationTestBase.php similarity index 97% rename from tests/functional/Blob/IntegrationTestBase.php rename to tests/Functional/Blob/IntegrationTestBase.php index cb7f3aee0..e71a985ee 100644 --- a/tests/functional/Blob/IntegrationTestBase.php +++ b/tests/Functional/Blob/IntegrationTestBase.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Blob; +namespace MicrosoftAzure\Storage\Tests\Functional\Blob; use MicrosoftAzure\Storage\Tests\Framework\BlobServiceRestProxyTestBase; use MicrosoftAzure\Storage\Common\Internal\StorageServiceSettings; diff --git a/tests/functional/Common/AccountSASFunctionalTest.php b/tests/Functional/Common/AccountSASFunctionalTest.php similarity index 98% rename from tests/functional/Common/AccountSASFunctionalTest.php rename to tests/Functional/Common/AccountSASFunctionalTest.php index 1dc086af3..1e0b0441c 100644 --- a/tests/functional/Common/AccountSASFunctionalTest.php +++ b/tests/Functional/Common/AccountSASFunctionalTest.php @@ -22,13 +22,13 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Common; +namespace MicrosoftAzure\Storage\Tests\Functional\Common; -use MicrosoftAzure\Storage\Tests\framework\SASFunctionalTestBase; +use MicrosoftAzure\Storage\Tests\Framework\SASFunctionalTestBase; use MicrosoftAzure\Storage\Common\Internal\Resources; -use MicrosoftAzure\Storage\Tests\framework\TestResources; +use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Exceptions\ServiceException; -use MicrosoftAzure\Storage\Tests\functional\Common\SharedAccessSignatureHelperMock; +use MicrosoftAzure\Storage\Tests\Functional\Common\SharedAccessSignatureHelperMock; /** * Tests for account SAS proxy tests. diff --git a/tests/functional/Common/AnonymousAccessFunctionalTest.php b/tests/Functional/Common/AnonymousAccessFunctionalTest.php similarity index 98% rename from tests/functional/Common/AnonymousAccessFunctionalTest.php rename to tests/Functional/Common/AnonymousAccessFunctionalTest.php index 1f974302b..b7e11c155 100644 --- a/tests/functional/Common/AnonymousAccessFunctionalTest.php +++ b/tests/Functional/Common/AnonymousAccessFunctionalTest.php @@ -22,12 +22,12 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Common; +namespace MicrosoftAzure\Storage\Tests\Functional\Common; use MicrosoftAzure\Storage\Common\Internal\Resources; use MicrosoftAzure\Storage\Common\Internal\Utilities; use MicrosoftAzure\Storage\Common\ServicesBuilder; -use MicrosoftAzure\Storage\Tests\framework\TestResources; +use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Exceptions\ServiceException; use MicrosoftAzure\Storage\Blob\Models\PublicAccessType; diff --git a/tests/functional/Common/ServiceSASFunctionalTest.php b/tests/Functional/Common/ServiceSASFunctionalTest.php similarity index 99% rename from tests/functional/Common/ServiceSASFunctionalTest.php rename to tests/Functional/Common/ServiceSASFunctionalTest.php index b975e9e8c..8764e153c 100644 --- a/tests/functional/Common/ServiceSASFunctionalTest.php +++ b/tests/Functional/Common/ServiceSASFunctionalTest.php @@ -22,13 +22,13 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Common; +namespace MicrosoftAzure\Storage\Tests\Functional\Common; -use MicrosoftAzure\Storage\Tests\framework\SASFunctionalTestBase; +use MicrosoftAzure\Storage\Tests\Framework\SASFunctionalTestBase; use MicrosoftAzure\Storage\Common\Internal\Resources; -use MicrosoftAzure\Storage\Tests\framework\TestResources; +use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Exceptions\ServiceException; -use MicrosoftAzure\Storage\Tests\functional\Common\SharedAccessSignatureHelperMock; +use MicrosoftAzure\Storage\Tests\Functional\Common\SharedAccessSignatureHelperMock; use MicrosoftAzure\Storage\Queue\Models\ListMessagesOptions; /** diff --git a/tests/functional/Common/SharedAccessSignatureHelperMock.php b/tests/Functional/Common/SharedAccessSignatureHelperMock.php similarity index 96% rename from tests/functional/Common/SharedAccessSignatureHelperMock.php rename to tests/Functional/Common/SharedAccessSignatureHelperMock.php index a7f45fe22..4bc837923 100644 --- a/tests/functional/Common/SharedAccessSignatureHelperMock.php +++ b/tests/Functional/Common/SharedAccessSignatureHelperMock.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Common; +namespace MicrosoftAzure\Storage\Tests\Functional\Common; use MicrosoftAzure\Storage\Common\SharedAccessSignatureHelper; diff --git a/tests/functional/File/FileServiceFunctionalTest.php b/tests/Functional/File/FileServiceFunctionalTest.php similarity index 99% rename from tests/functional/File/FileServiceFunctionalTest.php rename to tests/Functional/File/FileServiceFunctionalTest.php index e9f72f4fa..3efb5ac00 100644 --- a/tests/functional/File/FileServiceFunctionalTest.php +++ b/tests/Functional/File/FileServiceFunctionalTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\File; +namespace MicrosoftAzure\Storage\Tests\Functional\File; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\File\Models\GetFileOptions; diff --git a/tests/functional/File/FileServiceFunctionalTestData.php b/tests/Functional/File/FileServiceFunctionalTestData.php similarity index 99% rename from tests/functional/File/FileServiceFunctionalTestData.php rename to tests/Functional/File/FileServiceFunctionalTestData.php index c365ca592..1b0297b10 100644 --- a/tests/functional/File/FileServiceFunctionalTestData.php +++ b/tests/Functional/File/FileServiceFunctionalTestData.php @@ -22,11 +22,11 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\File; +namespace MicrosoftAzure\Storage\Tests\Functional\File; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\File\Models\AccessCondition; -use MicrosoftAzure\Storage\File\Models\ShareAcl; +use MicrosoftAzure\Storage\File\Models\ShareACL; use MicrosoftAzure\Storage\File\Models\GetFileOptions; use MicrosoftAzure\Storage\File\Models\FileProperties; use MicrosoftAzure\Storage\File\Models\FileServiceOptions; @@ -484,10 +484,10 @@ public static function getInterestingACL() $past = new \DateTime("01/01/2010"); $future = new \DateTime("01/01/2020"); - $acl = new ShareAcl(); + $acl = new ShareACL(); array_push($ret, $acl); - $acl = new ShareAcl(); + $acl = new ShareACL(); $acl->addSignedIdentifier('123', $past, $future, 'rw'); array_push($ret, $acl); diff --git a/tests/functional/File/FunctionalTestBase.php b/tests/Functional/File/FunctionalTestBase.php similarity index 98% rename from tests/functional/File/FunctionalTestBase.php rename to tests/Functional/File/FunctionalTestBase.php index eaf62c726..463513bb1 100644 --- a/tests/functional/File/FunctionalTestBase.php +++ b/tests/Functional/File/FunctionalTestBase.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\File; +namespace MicrosoftAzure\Storage\Tests\Functional\File; use MicrosoftAzure\Storage\Common\Exceptions\ServiceException; use MicrosoftAzure\Storage\Common\Internal\StorageServiceSettings; diff --git a/tests/functional/File/IntegrationTestBase.php b/tests/Functional/File/IntegrationTestBase.php similarity index 97% rename from tests/functional/File/IntegrationTestBase.php rename to tests/Functional/File/IntegrationTestBase.php index 9fbd009d0..2c4f1f68f 100644 --- a/tests/functional/File/IntegrationTestBase.php +++ b/tests/Functional/File/IntegrationTestBase.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\File; +namespace MicrosoftAzure\Storage\Tests\Functional\File; use MicrosoftAzure\Storage\Tests\Framework\FileServiceRestProxyTestBase; use MicrosoftAzure\Storage\Common\Internal\StorageServiceSettings; diff --git a/tests/functional/Queue/FunctionalTestBase.php b/tests/Functional/Queue/FunctionalTestBase.php similarity index 97% rename from tests/functional/Queue/FunctionalTestBase.php rename to tests/Functional/Queue/FunctionalTestBase.php index cfda55ba6..2c8e90efd 100644 --- a/tests/functional/Queue/FunctionalTestBase.php +++ b/tests/Functional/Queue/FunctionalTestBase.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Queue; +namespace MicrosoftAzure\Storage\Tests\Functional\Queue; use MicrosoftAzure\Storage\Common\Internal\StorageServiceSettings; diff --git a/tests/functional/Queue/IntegrationTestBase.php b/tests/Functional/Queue/IntegrationTestBase.php similarity index 96% rename from tests/functional/Queue/IntegrationTestBase.php rename to tests/Functional/Queue/IntegrationTestBase.php index 7fbe31e7a..dd91eec2c 100644 --- a/tests/functional/Queue/IntegrationTestBase.php +++ b/tests/Functional/Queue/IntegrationTestBase.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Queue; +namespace MicrosoftAzure\Storage\Tests\Functional\Queue; use MicrosoftAzure\Storage\Tests\Framework\QueueServiceRestProxyTestBase; diff --git a/tests/functional/Queue/QueueServiceFunctionalOptionsTest.php b/tests/Functional/Queue/QueueServiceFunctionalOptionsTest.php similarity index 99% rename from tests/functional/Queue/QueueServiceFunctionalOptionsTest.php rename to tests/Functional/Queue/QueueServiceFunctionalOptionsTest.php index 6467057c8..266d3b513 100644 --- a/tests/functional/Queue/QueueServiceFunctionalOptionsTest.php +++ b/tests/Functional/Queue/QueueServiceFunctionalOptionsTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Queue; +namespace MicrosoftAzure\Storage\Tests\Functional\Queue; use MicrosoftAzure\Storage\Common\Models\Logging; use MicrosoftAzure\Storage\Common\Models\Metrics; diff --git a/tests/functional/Queue/QueueServiceFunctionalParameterTest.php b/tests/Functional/Queue/QueueServiceFunctionalParameterTest.php similarity index 99% rename from tests/functional/Queue/QueueServiceFunctionalParameterTest.php rename to tests/Functional/Queue/QueueServiceFunctionalParameterTest.php index 005cec3c6..c54b7b024 100644 --- a/tests/functional/Queue/QueueServiceFunctionalParameterTest.php +++ b/tests/Functional/Queue/QueueServiceFunctionalParameterTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Queue; +namespace MicrosoftAzure\Storage\Tests\Functional\Queue; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Exceptions\ServiceException; diff --git a/tests/functional/Queue/QueueServiceFunctionalTest.php b/tests/Functional/Queue/QueueServiceFunctionalTest.php similarity index 99% rename from tests/functional/Queue/QueueServiceFunctionalTest.php rename to tests/Functional/Queue/QueueServiceFunctionalTest.php index 7f816f44f..63b6f827a 100644 --- a/tests/functional/Queue/QueueServiceFunctionalTest.php +++ b/tests/Functional/Queue/QueueServiceFunctionalTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Queue; +namespace MicrosoftAzure\Storage\Tests\Functional\Queue; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Exceptions\ServiceException; diff --git a/tests/functional/Queue/QueueServiceFunctionalTestData.php b/tests/Functional/Queue/QueueServiceFunctionalTestData.php similarity index 99% rename from tests/functional/Queue/QueueServiceFunctionalTestData.php rename to tests/Functional/Queue/QueueServiceFunctionalTestData.php index f80470ff0..17a99449b 100644 --- a/tests/functional/Queue/QueueServiceFunctionalTestData.php +++ b/tests/Functional/Queue/QueueServiceFunctionalTestData.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Queue; +namespace MicrosoftAzure\Storage\Tests\Functional\Queue; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Internal\Resources; diff --git a/tests/functional/Queue/QueueServiceIntegrationTest.php b/tests/Functional/Queue/QueueServiceIntegrationTest.php similarity index 99% rename from tests/functional/Queue/QueueServiceIntegrationTest.php rename to tests/Functional/Queue/QueueServiceIntegrationTest.php index 80dd6e0b6..f6861cf1b 100644 --- a/tests/functional/Queue/QueueServiceIntegrationTest.php +++ b/tests/Functional/Queue/QueueServiceIntegrationTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Queue; +namespace MicrosoftAzure\Storage\Tests\Functional\Queue; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Exceptions\ServiceException; diff --git a/tests/functional/Table/Enums/ConcurType.php b/tests/Functional/Table/Enums/ConcurType.php similarity index 95% rename from tests/functional/Table/Enums/ConcurType.php rename to tests/Functional/Table/Enums/ConcurType.php index f4edeb3b0..5ceeca050 100644 --- a/tests/functional/Table/Enums/ConcurType.php +++ b/tests/Functional/Table/Enums/ConcurType.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Table\Enums; +namespace MicrosoftAzure\Storage\Tests\Functional\Table\Enums; class ConcurType { diff --git a/tests/functional/Table/Enums/MutatePivot.php b/tests/Functional/Table/Enums/MutatePivot.php similarity index 95% rename from tests/functional/Table/Enums/MutatePivot.php rename to tests/Functional/Table/Enums/MutatePivot.php index 0889d7cde..34fd1e074 100644 --- a/tests/functional/Table/Enums/MutatePivot.php +++ b/tests/Functional/Table/Enums/MutatePivot.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Table\Enums; +namespace MicrosoftAzure\Storage\Tests\Functional\Table\Enums; class MutatePivot { diff --git a/tests/functional/Table/Enums/OpType.php b/tests/Functional/Table/Enums/OpType.php similarity index 95% rename from tests/functional/Table/Enums/OpType.php rename to tests/Functional/Table/Enums/OpType.php index b48515523..f1eddc096 100644 --- a/tests/functional/Table/Enums/OpType.php +++ b/tests/Functional/Table/Enums/OpType.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Table\Enums; +namespace MicrosoftAzure\Storage\Tests\Functional\Table\Enums; class OpType { diff --git a/tests/functional/Table/FunctionalTestBase.php b/tests/Functional/Table/FunctionalTestBase.php similarity index 98% rename from tests/functional/Table/FunctionalTestBase.php rename to tests/Functional/Table/FunctionalTestBase.php index 6fcc04148..da00422a5 100644 --- a/tests/functional/Table/FunctionalTestBase.php +++ b/tests/Functional/Table/FunctionalTestBase.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Table; +namespace MicrosoftAzure\Storage\Tests\Functional\Table; use MicrosoftAzure\Storage\Common\Internal\Utilities; use MicrosoftAzure\Storage\Table\Models\Entity; diff --git a/tests/functional/Table/IntegrationTestBase.php b/tests/Functional/Table/IntegrationTestBase.php similarity index 96% rename from tests/functional/Table/IntegrationTestBase.php rename to tests/Functional/Table/IntegrationTestBase.php index 753e58c5d..768642baf 100644 --- a/tests/functional/Table/IntegrationTestBase.php +++ b/tests/Functional/Table/IntegrationTestBase.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Table; +namespace MicrosoftAzure\Storage\Tests\Functional\Table; use MicrosoftAzure\Storage\Tests\Framework\TableServiceRestProxyTestBase; diff --git a/tests/functional/Table/Models/BatchWorkerConfig.php b/tests/Functional/Table/Models/BatchWorkerConfig.php similarity index 94% rename from tests/functional/Table/Models/BatchWorkerConfig.php rename to tests/Functional/Table/Models/BatchWorkerConfig.php index aff465e03..1069e8f0d 100644 --- a/tests/functional/Table/Models/BatchWorkerConfig.php +++ b/tests/Functional/Table/Models/BatchWorkerConfig.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Functional\Table\Models; class BatchWorkerConfig { diff --git a/tests/functional/Table/Models/FakeTableInfoEntry.php b/tests/Functional/Table/Models/FakeTableInfoEntry.php similarity index 93% rename from tests/functional/Table/Models/FakeTableInfoEntry.php rename to tests/Functional/Table/Models/FakeTableInfoEntry.php index 5cb655adc..2f07d19c3 100644 --- a/tests/functional/Table/Models/FakeTableInfoEntry.php +++ b/tests/Functional/Table/Models/FakeTableInfoEntry.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Functional\Table\Models; class FakeTableInfoEntry { diff --git a/tests/functional/Table/TableServiceFunctionalOptionsTest.php b/tests/Functional/Table/TableServiceFunctionalOptionsTest.php similarity index 99% rename from tests/functional/Table/TableServiceFunctionalOptionsTest.php rename to tests/Functional/Table/TableServiceFunctionalOptionsTest.php index 5e2b86aa4..4c1954929 100644 --- a/tests/functional/Table/TableServiceFunctionalOptionsTest.php +++ b/tests/Functional/Table/TableServiceFunctionalOptionsTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Table; +namespace MicrosoftAzure\Storage\Tests\Functional\Table; use MicrosoftAzure\Storage\Common\Models\Logging; use MicrosoftAzure\Storage\Common\Models\Metrics; diff --git a/tests/functional/Table/TableServiceFunctionalParametersTest.php b/tests/Functional/Table/TableServiceFunctionalParametersTest.php similarity index 99% rename from tests/functional/Table/TableServiceFunctionalParametersTest.php rename to tests/Functional/Table/TableServiceFunctionalParametersTest.php index 299c4e28a..966044b66 100644 --- a/tests/functional/Table/TableServiceFunctionalParametersTest.php +++ b/tests/Functional/Table/TableServiceFunctionalParametersTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Table; +namespace MicrosoftAzure\Storage\Tests\Functional\Table; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Exceptions\ServiceException; diff --git a/tests/functional/Table/TableServiceFunctionalQueryTest.php b/tests/Functional/Table/TableServiceFunctionalQueryTest.php similarity index 99% rename from tests/functional/Table/TableServiceFunctionalQueryTest.php rename to tests/Functional/Table/TableServiceFunctionalQueryTest.php index 34a16b4e5..2bc92f0c6 100644 --- a/tests/functional/Table/TableServiceFunctionalQueryTest.php +++ b/tests/Functional/Table/TableServiceFunctionalQueryTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Table; +namespace MicrosoftAzure\Storage\Tests\Functional\Table; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Exceptions\ServiceException; diff --git a/tests/functional/Table/TableServiceFunctionalTest.php b/tests/Functional/Table/TableServiceFunctionalTest.php similarity index 99% rename from tests/functional/Table/TableServiceFunctionalTest.php rename to tests/Functional/Table/TableServiceFunctionalTest.php index 59ec53b02..21444c725 100644 --- a/tests/functional/Table/TableServiceFunctionalTest.php +++ b/tests/Functional/Table/TableServiceFunctionalTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Table; +namespace MicrosoftAzure\Storage\Tests\Functional\Table; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Tests\Functional\Table\Enums\ConcurType; diff --git a/tests/functional/Table/TableServiceFunctionalTestData.php b/tests/Functional/Table/TableServiceFunctionalTestData.php similarity index 99% rename from tests/functional/Table/TableServiceFunctionalTestData.php rename to tests/Functional/Table/TableServiceFunctionalTestData.php index 282c28bbd..d3a399ad2 100644 --- a/tests/functional/Table/TableServiceFunctionalTestData.php +++ b/tests/Functional/Table/TableServiceFunctionalTestData.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Table; +namespace MicrosoftAzure\Storage\Tests\Functional\Table; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Internal\Utilities; diff --git a/tests/functional/Table/TableServiceFunctionalTestUtils.php b/tests/Functional/Table/TableServiceFunctionalTestUtils.php similarity index 99% rename from tests/functional/Table/TableServiceFunctionalTestUtils.php rename to tests/Functional/Table/TableServiceFunctionalTestUtils.php index 9fff2a8f0..07d4bde56 100644 --- a/tests/functional/Table/TableServiceFunctionalTestUtils.php +++ b/tests/Functional/Table/TableServiceFunctionalTestUtils.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Table; +namespace MicrosoftAzure\Storage\Tests\Functional\Table; use MicrosoftAzure\Storage\Tests\Functional\Table\Enums\MutatePivot; use MicrosoftAzure\Storage\Common\Internal\Utilities; diff --git a/tests/functional/Table/TableServiceIntegrationTest.php b/tests/Functional/Table/TableServiceIntegrationTest.php similarity index 99% rename from tests/functional/Table/TableServiceIntegrationTest.php rename to tests/Functional/Table/TableServiceIntegrationTest.php index 9b979c93b..48a0a8aac 100644 --- a/tests/functional/Table/TableServiceIntegrationTest.php +++ b/tests/Functional/Table/TableServiceIntegrationTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\functional\Table; +namespace MicrosoftAzure\Storage\Tests\Functional\Table; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Exceptions\ServiceException; diff --git a/tests/mock/Common/Internal/Authentication/OAuthSchemeMock.php b/tests/Mock/Common/Internal/Authentication/OAuthSchemeMock.php similarity index 96% rename from tests/mock/Common/Internal/Authentication/OAuthSchemeMock.php rename to tests/Mock/Common/Internal/Authentication/OAuthSchemeMock.php index b53840252..d33e208ed 100644 --- a/tests/mock/Common/Internal/Authentication/OAuthSchemeMock.php +++ b/tests/Mock/Common/Internal/Authentication/OAuthSchemeMock.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\mock\Common\Internal\Authentication; +namespace MicrosoftAzure\Storage\Tests\Mock\Common\Internal\Authentication; use MicrosoftAzure\Storage\Common\Internal\Authentication\OAuthScheme; diff --git a/tests/mock/Common/Internal/Authentication/SharedAccessSignatureAuthSchemeMock.php b/tests/Mock/Common/Internal/Authentication/SharedAccessSignatureAuthSchemeMock.php similarity index 96% rename from tests/mock/Common/Internal/Authentication/SharedAccessSignatureAuthSchemeMock.php rename to tests/Mock/Common/Internal/Authentication/SharedAccessSignatureAuthSchemeMock.php index 52ef33efe..f5f98ea4b 100644 --- a/tests/mock/Common/Internal/Authentication/SharedAccessSignatureAuthSchemeMock.php +++ b/tests/Mock/Common/Internal/Authentication/SharedAccessSignatureAuthSchemeMock.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\mock\Common\Internal\Authentication; +namespace MicrosoftAzure\Storage\Tests\Mock\Common\Internal\Authentication; use MicrosoftAzure\Storage\Common\Internal\Authentication\SharedAccessSignatureAuthScheme; diff --git a/tests/mock/Common/Internal/Authentication/SharedKeyAuthSchemeMock.php b/tests/Mock/Common/Internal/Authentication/SharedKeyAuthSchemeMock.php similarity index 97% rename from tests/mock/Common/Internal/Authentication/SharedKeyAuthSchemeMock.php rename to tests/Mock/Common/Internal/Authentication/SharedKeyAuthSchemeMock.php index acff188f3..13413b23e 100644 --- a/tests/mock/Common/Internal/Authentication/SharedKeyAuthSchemeMock.php +++ b/tests/Mock/Common/Internal/Authentication/SharedKeyAuthSchemeMock.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\mock\Common\Internal\Authentication; +namespace MicrosoftAzure\Storage\Tests\Mock\Common\Internal\Authentication; use MicrosoftAzure\Storage\Common\Internal\Authentication\SharedKeyAuthScheme; diff --git a/tests/mock/Common/Internal/Authentication/TableSharedKeyLiteAuthSchemeMock.php b/tests/Mock/Common/Internal/Authentication/TableSharedKeyLiteAuthSchemeMock.php similarity index 96% rename from tests/mock/Common/Internal/Authentication/TableSharedKeyLiteAuthSchemeMock.php rename to tests/Mock/Common/Internal/Authentication/TableSharedKeyLiteAuthSchemeMock.php index 581830241..1767065ad 100644 --- a/tests/mock/Common/Internal/Authentication/TableSharedKeyLiteAuthSchemeMock.php +++ b/tests/Mock/Common/Internal/Authentication/TableSharedKeyLiteAuthSchemeMock.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\mock\Common\Internal\Authentication; +namespace MicrosoftAzure\Storage\Tests\Mock\Common\Internal\Authentication; use MicrosoftAzure\Storage\Common\Internal\Authentication\TableSharedKeyLiteAuthScheme; diff --git a/tests/unit/Blob/BlobRestProxyTest.php b/tests/Unit/Blob/BlobRestProxyTest.php similarity index 99% rename from tests/unit/Blob/BlobRestProxyTest.php rename to tests/Unit/Blob/BlobRestProxyTest.php index 96bc72425..8967bac76 100644 --- a/tests/unit/Blob/BlobRestProxyTest.php +++ b/tests/Unit/Blob/BlobRestProxyTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob; use MicrosoftAzure\Storage\Tests\Framework\VirtualFileSystem; use MicrosoftAzure\Storage\Tests\Framework\BlobServiceRestProxyTestBase; @@ -38,7 +38,7 @@ use MicrosoftAzure\Storage\Blob\Models\ListContainersResult; use MicrosoftAzure\Storage\Blob\Models\CreateContainerOptions; use MicrosoftAzure\Storage\Blob\Models\GetContainerPropertiesResult; -use MicrosoftAzure\Storage\Blob\Models\ContainerAcl; +use MicrosoftAzure\Storage\Blob\Models\ContainerACL; use MicrosoftAzure\Storage\Blob\Models\ListBlobsResult; use MicrosoftAzure\Storage\Blob\Models\ListBlobsOptions; use MicrosoftAzure\Storage\Blob\Models\ListBlobBlocksOptions; @@ -474,7 +474,7 @@ public function testSetContainerAcl() $expectedETag = '0x8CAFB82EFF70C46'; $expectedLastModified = new \DateTime('Sun, 25 Sep 2011 19:42:18 GMT'); $expectedPublicAccess = 'container'; - $acl = ContainerAcl::create($expectedPublicAccess, $sample['SignedIdentifiers']); + $acl = ContainerACL::create($expectedPublicAccess, $sample['SignedIdentifiers']); // Test $this->restProxy->setContainerAcl($name, $acl); diff --git a/tests/unit/Blob/Models/AccessConditionTest.php b/tests/Unit/Blob/Models/AccessConditionTest.php similarity index 99% rename from tests/unit/Blob/Models/AccessConditionTest.php rename to tests/Unit/Blob/Models/AccessConditionTest.php index 75b7cfdff..f5600dc32 100644 --- a/tests/unit/Blob/Models/AccessConditionTest.php +++ b/tests/Unit/Blob/Models/AccessConditionTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\AccessCondition; use MicrosoftAzure\Storage\Common\Internal\Resources; diff --git a/tests/unit/Blob/Models/BlobBlockTypeTest.php b/tests/Unit/Blob/Models/BlobBlockTypeTest.php similarity index 96% rename from tests/unit/Blob/Models/BlobBlockTypeTest.php rename to tests/Unit/Blob/Models/BlobBlockTypeTest.php index b841b4f3b..5dc3f0086 100644 --- a/tests/unit/Blob/Models/BlobBlockTypeTest.php +++ b/tests/Unit/Blob/Models/BlobBlockTypeTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\BlobBlockType; diff --git a/tests/unit/Blob/Models/BlobPrefixTest.php b/tests/Unit/Blob/Models/BlobPrefixTest.php similarity index 97% rename from tests/unit/Blob/Models/BlobPrefixTest.php rename to tests/Unit/Blob/Models/BlobPrefixTest.php index a63e51b96..ff24d88a5 100644 --- a/tests/unit/Blob/Models/BlobPrefixTest.php +++ b/tests/Unit/Blob/Models/BlobPrefixTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\BlobPrefix; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Blob/Models/BlobPropertiesTest.php b/tests/Unit/Blob/Models/BlobPropertiesTest.php similarity index 99% rename from tests/unit/Blob/Models/BlobPropertiesTest.php rename to tests/Unit/Blob/Models/BlobPropertiesTest.php index 0d08389fc..45ae1b5f4 100644 --- a/tests/unit/Blob/Models/BlobPropertiesTest.php +++ b/tests/Unit/Blob/Models/BlobPropertiesTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Blob\Models\BlobProperties; diff --git a/tests/unit/Blob/Models/BlobTest.php b/tests/Unit/Blob/Models/BlobTest.php similarity index 98% rename from tests/unit/Blob/Models/BlobTest.php rename to tests/Unit/Blob/Models/BlobTest.php index 677d1b085..3cc3ed3d1 100644 --- a/tests/unit/Blob/Models/BlobTest.php +++ b/tests/Unit/Blob/Models/BlobTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\Blob; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Blob/Models/BlobTypeTest.php b/tests/Unit/Blob/Models/BlobTypeTest.php similarity index 96% rename from tests/unit/Blob/Models/BlobTypeTest.php rename to tests/Unit/Blob/Models/BlobTypeTest.php index 44c743927..f0509f6a0 100644 --- a/tests/unit/Blob/Models/BlobTypeTest.php +++ b/tests/Unit/Blob/Models/BlobTypeTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\BlobType; diff --git a/tests/unit/Blob/Models/BlockListTest.php b/tests/Unit/Blob/Models/BlockListTest.php similarity index 99% rename from tests/unit/Blob/Models/BlockListTest.php rename to tests/Unit/Blob/Models/BlockListTest.php index a8cd9653a..89d7f636f 100644 --- a/tests/unit/Blob/Models/BlockListTest.php +++ b/tests/Unit/Blob/Models/BlockListTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\Serialization\XmlSerializer; use MicrosoftAzure\Storage\Blob\Models\BlockList; diff --git a/tests/unit/Blob/Models/BlockTest.php b/tests/Unit/Blob/Models/BlockTest.php similarity index 97% rename from tests/unit/Blob/Models/BlockTest.php rename to tests/Unit/Blob/Models/BlockTest.php index a79ff5a7d..360e7b460 100644 --- a/tests/unit/Blob/Models/BlockTest.php +++ b/tests/Unit/Blob/Models/BlockTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\Block; diff --git a/tests/unit/Blob/Models/BreakLeaseResultTest.php b/tests/Unit/Blob/Models/BreakLeaseResultTest.php similarity index 97% rename from tests/unit/Blob/Models/BreakLeaseResultTest.php rename to tests/Unit/Blob/Models/BreakLeaseResultTest.php index a7706069c..a50d4dab8 100644 --- a/tests/unit/Blob/Models/BreakLeaseResultTest.php +++ b/tests/Unit/Blob/Models/BreakLeaseResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\BreakLeaseResult; diff --git a/tests/unit/Blob/Models/CommitBlobBlocksOptionsTest.php b/tests/Unit/Blob/Models/CommitBlobBlocksOptionsTest.php similarity index 99% rename from tests/unit/Blob/Models/CommitBlobBlocksOptionsTest.php rename to tests/Unit/Blob/Models/CommitBlobBlocksOptionsTest.php index 497f28f75..50d1641e0 100644 --- a/tests/unit/Blob/Models/CommitBlobBlocksOptionsTest.php +++ b/tests/Unit/Blob/Models/CommitBlobBlocksOptionsTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\CommitBlobBlocksOptions; use MicrosoftAzure\Storage\Blob\Models\AccessCondition; diff --git a/tests/unit/Blob/Models/ContainerACLTest.php b/tests/Unit/Blob/Models/ContainerACLTest.php similarity index 70% rename from tests/unit/Blob/Models/ContainerACLTest.php rename to tests/Unit/Blob/Models/ContainerACLTest.php index 9b0dc9ba8..d4f0953f8 100644 --- a/tests/unit/Blob/Models/ContainerACLTest.php +++ b/tests/Unit/Blob/Models/ContainerACLTest.php @@ -21,9 +21,9 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; -use MicrosoftAzure\Storage\Blob\Models\ContainerAcl; +use MicrosoftAzure\Storage\Blob\Models\ContainerACL; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Internal\Resources; use MicrosoftAzure\Storage\Common\Internal\Utilities; @@ -42,11 +42,11 @@ class ContainerACLTest extends \PHPUnit_Framework_TestCase { /** - * @covers MicrosoftAzure\Storage\Blob\Models\ContainerAcl::create - * @covers MicrosoftAzure\Storage\Blob\Models\ContainerAcl::getPublicAccess - * @covers MicrosoftAzure\Storage\Blob\Models\ContainerAcl::getSignedIdentifiers - * @covers MicrosoftAzure\Storage\Blob\Models\ContainerAcl::addSignedIdentifier - * @covers MicrosoftAzure\Storage\Blob\Models\ContainerAcl::fromXmlArray + * @covers MicrosoftAzure\Storage\Blob\Models\ContainerACL::create + * @covers MicrosoftAzure\Storage\Blob\Models\ContainerACL::getPublicAccess + * @covers MicrosoftAzure\Storage\Blob\Models\ContainerACL::getSignedIdentifiers + * @covers MicrosoftAzure\Storage\Blob\Models\ContainerACL::addSignedIdentifier + * @covers MicrosoftAzure\Storage\Blob\Models\ContainerACL::fromXmlArray */ public function testCreateEmpty() { @@ -55,7 +55,7 @@ public function testCreateEmpty() $expectedPublicAccess = 'container'; // Test - $acl = ContainerAcl::create($expectedPublicAccess, $sample); + $acl = ContainerACL::create($expectedPublicAccess, $sample); // Assert $this->assertEquals($expectedPublicAccess, $acl->getPublicAccess()); @@ -63,11 +63,11 @@ public function testCreateEmpty() } /** - * @covers MicrosoftAzure\Storage\Blob\Models\ContainerAcl::create - * @covers MicrosoftAzure\Storage\Blob\Models\ContainerAcl::getPublicAccess - * @covers MicrosoftAzure\Storage\Blob\Models\ContainerAcl::getSignedIdentifiers - * @covers MicrosoftAzure\Storage\Blob\Models\ContainerAcl::addSignedIdentifier - * @covers MicrosoftAzure\Storage\Blob\Models\ContainerAcl::fromXmlArray + * @covers MicrosoftAzure\Storage\Blob\Models\ContainerACL::create + * @covers MicrosoftAzure\Storage\Blob\Models\ContainerACL::getPublicAccess + * @covers MicrosoftAzure\Storage\Blob\Models\ContainerACL::getSignedIdentifiers + * @covers MicrosoftAzure\Storage\Blob\Models\ContainerACL::addSignedIdentifier + * @covers MicrosoftAzure\Storage\Blob\Models\ContainerACL::fromXmlArray */ public function testCreateOneEntry() { @@ -76,7 +76,7 @@ public function testCreateOneEntry() $expectedPublicAccess = 'container'; // Test - $acl = ContainerAcl::create($expectedPublicAccess, $sample['SignedIdentifiers']); + $acl = ContainerACL::create($expectedPublicAccess, $sample['SignedIdentifiers']); // Assert $this->assertEquals($expectedPublicAccess, $acl->getPublicAccess()); @@ -84,11 +84,11 @@ public function testCreateOneEntry() } /** - * @covers MicrosoftAzure\Storage\Blob\Models\ContainerAcl::create - * @covers MicrosoftAzure\Storage\Blob\Models\ContainerAcl::getPublicAccess - * @covers MicrosoftAzure\Storage\Blob\Models\ContainerAcl::getSignedIdentifiers - * @covers MicrosoftAzure\Storage\Blob\Models\ContainerAcl::addSignedIdentifier - * @covers MicrosoftAzure\Storage\Blob\Models\ContainerAcl::fromXmlArray + * @covers MicrosoftAzure\Storage\Blob\Models\ContainerACL::create + * @covers MicrosoftAzure\Storage\Blob\Models\ContainerACL::getPublicAccess + * @covers MicrosoftAzure\Storage\Blob\Models\ContainerACL::getSignedIdentifiers + * @covers MicrosoftAzure\Storage\Blob\Models\ContainerACL::addSignedIdentifier + * @covers MicrosoftAzure\Storage\Blob\Models\ContainerACL::fromXmlArray */ public function testCreateMultipleEntries() { @@ -97,7 +97,7 @@ public function testCreateMultipleEntries() $expectedPublicAccess = 'container'; // Test - $acl = ContainerAcl::create($expectedPublicAccess, $sample['SignedIdentifiers']); + $acl = ContainerACL::create($expectedPublicAccess, $sample['SignedIdentifiers']); // Assert $this->assertEquals($expectedPublicAccess, $acl->getPublicAccess()); @@ -107,14 +107,14 @@ public function testCreateMultipleEntries() } /** - * @covers MicrosoftAzure\Storage\Blob\Models\ContainerAcl::setPublicAccess - * @covers MicrosoftAzure\Storage\Blob\Models\ContainerAcl::getPublicAccess + * @covers MicrosoftAzure\Storage\Blob\Models\ContainerACL::setPublicAccess + * @covers MicrosoftAzure\Storage\Blob\Models\ContainerACL::getPublicAccess */ public function testSetPublicAccess() { // Setup $expected = 'container'; - $acl = new ContainerAcl(); + $acl = new ContainerACL(); $acl->setPublicAccess($expected); // Test diff --git a/tests/unit/Blob/Models/ContainerPropertiesTest.php b/tests/Unit/Blob/Models/ContainerPropertiesTest.php similarity index 98% rename from tests/unit/Blob/Models/ContainerPropertiesTest.php rename to tests/Unit/Blob/Models/ContainerPropertiesTest.php index f821aad21..f4d48039a 100644 --- a/tests/unit/Blob/Models/ContainerPropertiesTest.php +++ b/tests/Unit/Blob/Models/ContainerPropertiesTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\ContainerProperties; diff --git a/tests/unit/Blob/Models/ContainerTest.php b/tests/Unit/Blob/Models/ContainerTest.php similarity index 98% rename from tests/unit/Blob/Models/ContainerTest.php rename to tests/Unit/Blob/Models/ContainerTest.php index 5b0238d93..ab2be8b0d 100644 --- a/tests/unit/Blob/Models/ContainerTest.php +++ b/tests/Unit/Blob/Models/ContainerTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\Container; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Blob/Models/CopyBlobOptionsTest.php b/tests/Unit/Blob/Models/CopyBlobOptionsTest.php similarity index 98% rename from tests/unit/Blob/Models/CopyBlobOptionsTest.php rename to tests/Unit/Blob/Models/CopyBlobOptionsTest.php index 37c34218d..3106d0419 100644 --- a/tests/unit/Blob/Models/CopyBlobOptionsTest.php +++ b/tests/Unit/Blob/Models/CopyBlobOptionsTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Internal\Utilities; diff --git a/tests/unit/Blob/Models/CopyBlobResultTest.php b/tests/Unit/Blob/Models/CopyBlobResultTest.php similarity index 97% rename from tests/unit/Blob/Models/CopyBlobResultTest.php rename to tests/Unit/Blob/Models/CopyBlobResultTest.php index 3617aec1b..97183befe 100644 --- a/tests/unit/Blob/Models/CopyBlobResultTest.php +++ b/tests/Unit/Blob/Models/CopyBlobResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Internal\Utilities; diff --git a/tests/unit/Blob/Models/CreateBlobBlockOptionsTest.php b/tests/Unit/Blob/Models/CreateBlobBlockOptionsTest.php similarity index 97% rename from tests/unit/Blob/Models/CreateBlobBlockOptionsTest.php rename to tests/Unit/Blob/Models/CreateBlobBlockOptionsTest.php index 3e43d01f1..616b54655 100644 --- a/tests/unit/Blob/Models/CreateBlobBlockOptionsTest.php +++ b/tests/Unit/Blob/Models/CreateBlobBlockOptionsTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\CreateBlobBlockOptions; diff --git a/tests/unit/Blob/Models/CreateBlobOptionsTest.php b/tests/Unit/Blob/Models/CreateBlobOptionsTest.php similarity index 99% rename from tests/unit/Blob/Models/CreateBlobOptionsTest.php rename to tests/Unit/Blob/Models/CreateBlobOptionsTest.php index 3b3b44c52..fd45f08e5 100644 --- a/tests/unit/Blob/Models/CreateBlobOptionsTest.php +++ b/tests/Unit/Blob/Models/CreateBlobOptionsTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Internal\Utilities; diff --git a/tests/unit/Blob/Models/CreateBlobPagesOptionsTest.php b/tests/Unit/Blob/Models/CreateBlobPagesOptionsTest.php similarity index 98% rename from tests/unit/Blob/Models/CreateBlobPagesOptionsTest.php rename to tests/Unit/Blob/Models/CreateBlobPagesOptionsTest.php index ec5b13bde..926b320f3 100644 --- a/tests/unit/Blob/Models/CreateBlobPagesOptionsTest.php +++ b/tests/Unit/Blob/Models/CreateBlobPagesOptionsTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\CreateBlobPagesOptions; use MicrosoftAzure\Storage\Blob\Models\AccessCondition; diff --git a/tests/unit/Blob/Models/CreateBlobPagesResultTest.php b/tests/Unit/Blob/Models/CreateBlobPagesResultTest.php similarity index 98% rename from tests/unit/Blob/Models/CreateBlobPagesResultTest.php rename to tests/Unit/Blob/Models/CreateBlobPagesResultTest.php index 4549827e7..db5893fa9 100644 --- a/tests/unit/Blob/Models/CreateBlobPagesResultTest.php +++ b/tests/Unit/Blob/Models/CreateBlobPagesResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Internal\Utilities; diff --git a/tests/unit/Blob/Models/CreateBlobSnapshotOptionsTest.php b/tests/Unit/Blob/Models/CreateBlobSnapshotOptionsTest.php similarity index 97% rename from tests/unit/Blob/Models/CreateBlobSnapshotOptionsTest.php rename to tests/Unit/Blob/Models/CreateBlobSnapshotOptionsTest.php index 72a0c5dea..33eed5127 100644 --- a/tests/unit/Blob/Models/CreateBlobSnapshotOptionsTest.php +++ b/tests/Unit/Blob/Models/CreateBlobSnapshotOptionsTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Internal\Utilities; diff --git a/tests/unit/Blob/Models/CreateBlobSnapshotResultTest.php b/tests/Unit/Blob/Models/CreateBlobSnapshotResultTest.php similarity index 97% rename from tests/unit/Blob/Models/CreateBlobSnapshotResultTest.php rename to tests/Unit/Blob/Models/CreateBlobSnapshotResultTest.php index 29c93d0c7..054664d23 100644 --- a/tests/unit/Blob/Models/CreateBlobSnapshotResultTest.php +++ b/tests/Unit/Blob/Models/CreateBlobSnapshotResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Internal\Utilities; diff --git a/tests/unit/Blob/Models/CreateContainerOptionsTest.php b/tests/Unit/Blob/Models/CreateContainerOptionsTest.php similarity index 98% rename from tests/unit/Blob/Models/CreateContainerOptionsTest.php rename to tests/Unit/Blob/Models/CreateContainerOptionsTest.php index 6cd07099f..8efe533ab 100644 --- a/tests/unit/Blob/Models/CreateContainerOptionsTest.php +++ b/tests/Unit/Blob/Models/CreateContainerOptionsTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\CreateContainerOptions; use MicrosoftAzure\Storage\Common\Exceptions\InvalidArgumentTypeException; diff --git a/tests/unit/Blob/Models/DeleteBlobOptionsTest.php b/tests/Unit/Blob/Models/DeleteBlobOptionsTest.php similarity index 98% rename from tests/unit/Blob/Models/DeleteBlobOptionsTest.php rename to tests/Unit/Blob/Models/DeleteBlobOptionsTest.php index df74dfc00..57fdac82a 100644 --- a/tests/unit/Blob/Models/DeleteBlobOptionsTest.php +++ b/tests/Unit/Blob/Models/DeleteBlobOptionsTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Blob\Models\AccessCondition; diff --git a/tests/unit/Blob/Models/GetBlobMetadataOptionsTest.php b/tests/Unit/Blob/Models/GetBlobMetadataOptionsTest.php similarity index 98% rename from tests/unit/Blob/Models/GetBlobMetadataOptionsTest.php rename to tests/Unit/Blob/Models/GetBlobMetadataOptionsTest.php index 078c024d8..d6bf66020 100644 --- a/tests/unit/Blob/Models/GetBlobMetadataOptionsTest.php +++ b/tests/Unit/Blob/Models/GetBlobMetadataOptionsTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Blob\Models\AccessCondition; diff --git a/tests/unit/Blob/Models/GetBlobMetadataResultTest.php b/tests/Unit/Blob/Models/GetBlobMetadataResultTest.php similarity index 98% rename from tests/unit/Blob/Models/GetBlobMetadataResultTest.php rename to tests/Unit/Blob/Models/GetBlobMetadataResultTest.php index d685d9bbd..9863bf1f7 100644 --- a/tests/unit/Blob/Models/GetBlobMetadataResultTest.php +++ b/tests/Unit/Blob/Models/GetBlobMetadataResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\Utilities; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Blob/Models/GetBlobOptionsTest.php b/tests/Unit/Blob/Models/GetBlobOptionsTest.php similarity index 99% rename from tests/unit/Blob/Models/GetBlobOptionsTest.php rename to tests/Unit/Blob/Models/GetBlobOptionsTest.php index 874a65465..9c2ae4e37 100644 --- a/tests/unit/Blob/Models/GetBlobOptionsTest.php +++ b/tests/Unit/Blob/Models/GetBlobOptionsTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Blob\Models\AccessCondition; diff --git a/tests/unit/Blob/Models/GetBlobPropertiesOptionsTest.php b/tests/Unit/Blob/Models/GetBlobPropertiesOptionsTest.php similarity index 98% rename from tests/unit/Blob/Models/GetBlobPropertiesOptionsTest.php rename to tests/Unit/Blob/Models/GetBlobPropertiesOptionsTest.php index 5fde3a8f5..62ea66b41 100644 --- a/tests/unit/Blob/Models/GetBlobPropertiesOptionsTest.php +++ b/tests/Unit/Blob/Models/GetBlobPropertiesOptionsTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Blob\Models\AccessCondition; diff --git a/tests/unit/Blob/Models/GetBlobPropertiesResultTest.php b/tests/Unit/Blob/Models/GetBlobPropertiesResultTest.php similarity index 97% rename from tests/unit/Blob/Models/GetBlobPropertiesResultTest.php rename to tests/Unit/Blob/Models/GetBlobPropertiesResultTest.php index e3aac420c..b37b26305 100644 --- a/tests/unit/Blob/Models/GetBlobPropertiesResultTest.php +++ b/tests/Unit/Blob/Models/GetBlobPropertiesResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\GetBlobPropertiesResult; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Blob/Models/GetBlobResultTest.php b/tests/Unit/Blob/Models/GetBlobResultTest.php similarity index 98% rename from tests/unit/Blob/Models/GetBlobResultTest.php rename to tests/Unit/Blob/Models/GetBlobResultTest.php index 989342f16..57bc28f47 100644 --- a/tests/unit/Blob/Models/GetBlobResultTest.php +++ b/tests/Unit/Blob/Models/GetBlobResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\Utilities; use MicrosoftAzure\Storage\Blob\Models\GetBlobResult; diff --git a/tests/unit/Blob/Models/GetContainerACLResultTest.php b/tests/Unit/Blob/Models/GetContainerACLResultTest.php similarity index 98% rename from tests/unit/Blob/Models/GetContainerACLResultTest.php rename to tests/Unit/Blob/Models/GetContainerACLResultTest.php index b69ed32f6..5b2014506 100644 --- a/tests/unit/Blob/Models/GetContainerACLResultTest.php +++ b/tests/Unit/Blob/Models/GetContainerACLResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\GetContainerACLResult; use MicrosoftAzure\Storage\Blob\Models\ContainerACL; diff --git a/tests/unit/Blob/Models/GetContainerPropertiesResultTest.php b/tests/Unit/Blob/Models/GetContainerPropertiesResultTest.php similarity index 98% rename from tests/unit/Blob/Models/GetContainerPropertiesResultTest.php rename to tests/Unit/Blob/Models/GetContainerPropertiesResultTest.php index 29b025fee..d0d5d6d10 100644 --- a/tests/unit/Blob/Models/GetContainerPropertiesResultTest.php +++ b/tests/Unit/Blob/Models/GetContainerPropertiesResultTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\GetContainerPropertiesResult; use MicrosoftAzure\Storage\Common\Internal\Utilities; diff --git a/tests/unit/Blob/Models/LeaseModeTest.php b/tests/Unit/Blob/Models/LeaseModeTest.php similarity index 96% rename from tests/unit/Blob/Models/LeaseModeTest.php rename to tests/Unit/Blob/Models/LeaseModeTest.php index 320f888e7..d3a8ead46 100644 --- a/tests/unit/Blob/Models/LeaseModeTest.php +++ b/tests/Unit/Blob/Models/LeaseModeTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\LeaseMode; diff --git a/tests/unit/Blob/Models/LeaseBlobResultTest.php b/tests/Unit/Blob/Models/LeaseResultTest.php similarity index 97% rename from tests/unit/Blob/Models/LeaseBlobResultTest.php rename to tests/Unit/Blob/Models/LeaseResultTest.php index fd86a031c..893090f3d 100644 --- a/tests/unit/Blob/Models/LeaseBlobResultTest.php +++ b/tests/Unit/Blob/Models/LeaseResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\LeaseResult; diff --git a/tests/unit/Blob/Models/ListBlobBlocksOptionsTest.php b/tests/Unit/Blob/Models/ListBlobBlocksOptionsTest.php similarity index 98% rename from tests/unit/Blob/Models/ListBlobBlocksOptionsTest.php rename to tests/Unit/Blob/Models/ListBlobBlocksOptionsTest.php index cffd8c227..9c5ce2d23 100644 --- a/tests/unit/Blob/Models/ListBlobBlocksOptionsTest.php +++ b/tests/Unit/Blob/Models/ListBlobBlocksOptionsTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Blob\Models\ListBlobBlocksOptions; diff --git a/tests/unit/Blob/Models/ListBlobBlocksResultTest.php b/tests/Unit/Blob/Models/ListBlobBlocksResultTest.php similarity index 98% rename from tests/unit/Blob/Models/ListBlobBlocksResultTest.php rename to tests/Unit/Blob/Models/ListBlobBlocksResultTest.php index 63a7549d2..3b1bf87f3 100644 --- a/tests/unit/Blob/Models/ListBlobBlocksResultTest.php +++ b/tests/Unit/Blob/Models/ListBlobBlocksResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\ListBlobBlocksResult; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Blob/Models/ListBlobsOptionsTest.php b/tests/Unit/Blob/Models/ListBlobsOptionsTest.php similarity index 99% rename from tests/unit/Blob/Models/ListBlobsOptionsTest.php rename to tests/Unit/Blob/Models/ListBlobsOptionsTest.php index 673e70cb2..94e958ff2 100644 --- a/tests/unit/Blob/Models/ListBlobsOptionsTest.php +++ b/tests/Unit/Blob/Models/ListBlobsOptionsTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\ListBlobsOptions; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Blob/Models/ListBlobsResultTest.php b/tests/Unit/Blob/Models/ListBlobsResultTest.php similarity index 99% rename from tests/unit/Blob/Models/ListBlobsResultTest.php rename to tests/Unit/Blob/Models/ListBlobsResultTest.php index bbd6e8e01..6b83329e5 100644 --- a/tests/unit/Blob/Models/ListBlobsResultTest.php +++ b/tests/Unit/Blob/Models/ListBlobsResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\ListBlobsResult; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Blob/Models/ListContainersOptionsTest.php b/tests/Unit/Blob/Models/ListContainersOptionsTest.php similarity index 98% rename from tests/unit/Blob/Models/ListContainersOptionsTest.php rename to tests/Unit/Blob/Models/ListContainersOptionsTest.php index af1e2d26d..cc2f5c859 100644 --- a/tests/unit/Blob/Models/ListContainersOptionsTest.php +++ b/tests/Unit/Blob/Models/ListContainersOptionsTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\ListContainersOptions; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Blob/Models/ListContainersResultTest.php b/tests/Unit/Blob/Models/ListContainersResultTest.php similarity index 99% rename from tests/unit/Blob/Models/ListContainersResultTest.php rename to tests/Unit/Blob/Models/ListContainersResultTest.php index 91b75f316..339e64497 100644 --- a/tests/unit/Blob/Models/ListContainersResultTest.php +++ b/tests/Unit/Blob/Models/ListContainersResultTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\ListContainersResult; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Blob/Models/ListPageBlobRangesDiffResultTest.php b/tests/Unit/Blob/Models/ListPageBlobRangesDiffResultTest.php similarity index 98% rename from tests/unit/Blob/Models/ListPageBlobRangesDiffResultTest.php rename to tests/Unit/Blob/Models/ListPageBlobRangesDiffResultTest.php index abeccc66c..34374f5c4 100644 --- a/tests/unit/Blob/Models/ListPageBlobRangesDiffResultTest.php +++ b/tests/Unit/Blob/Models/ListPageBlobRangesDiffResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\Utilities; use MicrosoftAzure\Storage\Blob\Models\ListPageBlobRangesDiffResult; diff --git a/tests/unit/Blob/Models/ListPageBlobRangesOptionsTest.php b/tests/Unit/Blob/Models/ListPageBlobRangesOptionsTest.php similarity index 98% rename from tests/unit/Blob/Models/ListPageBlobRangesOptionsTest.php rename to tests/Unit/Blob/Models/ListPageBlobRangesOptionsTest.php index d59263323..590d9fdb1 100644 --- a/tests/unit/Blob/Models/ListPageBlobRangesOptionsTest.php +++ b/tests/Unit/Blob/Models/ListPageBlobRangesOptionsTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\ListPageBlobRangesOptions; use MicrosoftAzure\Storage\Blob\Models\AccessCondition; diff --git a/tests/unit/Blob/Models/ListPageBlobRangesResultTest.php b/tests/Unit/Blob/Models/ListPageBlobRangesResultTest.php similarity index 98% rename from tests/unit/Blob/Models/ListPageBlobRangesResultTest.php rename to tests/Unit/Blob/Models/ListPageBlobRangesResultTest.php index f3b184b39..f4bf73eea 100644 --- a/tests/unit/Blob/Models/ListPageBlobRangesResultTest.php +++ b/tests/Unit/Blob/Models/ListPageBlobRangesResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\Utilities; use MicrosoftAzure\Storage\Common\Models\Range; diff --git a/tests/unit/Blob/Models/PublicAccessTypeTest.php b/tests/Unit/Blob/Models/PublicAccessTypeTest.php similarity index 96% rename from tests/unit/Blob/Models/PublicAccessTypeTest.php rename to tests/Unit/Blob/Models/PublicAccessTypeTest.php index 6964d4981..68268cead 100644 --- a/tests/unit/Blob/Models/PublicAccessTypeTest.php +++ b/tests/Unit/Blob/Models/PublicAccessTypeTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\PublicAccessType; use MicrosoftAzure\Storage\Common\Internal\Resources; diff --git a/tests/unit/Blob/Models/PutBlobResultTest.php b/tests/Unit/Blob/Models/PutBlobResultTest.php similarity index 98% rename from tests/unit/Blob/Models/PutBlobResultTest.php rename to tests/Unit/Blob/Models/PutBlobResultTest.php index e51d49461..ef24a415e 100644 --- a/tests/unit/Blob/Models/PutBlobResultTest.php +++ b/tests/Unit/Blob/Models/PutBlobResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Internal\Utilities; diff --git a/tests/unit/Blob/Models/PutBlockResultTest.php b/tests/Unit/Blob/Models/PutBlockResultTest.php similarity index 97% rename from tests/unit/Blob/Models/PutBlockResultTest.php rename to tests/Unit/Blob/Models/PutBlockResultTest.php index 5142a9851..74f090374 100644 --- a/tests/unit/Blob/Models/PutBlockResultTest.php +++ b/tests/Unit/Blob/Models/PutBlockResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\Utilities; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Blob/Models/SetBlobMetadataResultTest.php b/tests/Unit/Blob/Models/SetBlobMetadataResultTest.php similarity index 97% rename from tests/unit/Blob/Models/SetBlobMetadataResultTest.php rename to tests/Unit/Blob/Models/SetBlobMetadataResultTest.php index aa5fc267a..44b6d25f1 100644 --- a/tests/unit/Blob/Models/SetBlobMetadataResultTest.php +++ b/tests/Unit/Blob/Models/SetBlobMetadataResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\Utilities; use MicrosoftAzure\Storage\Blob\Models\SetBlobMetadataResult; diff --git a/tests/unit/Blob/Models/SetBlobPropertiesOptionsTest.php b/tests/Unit/Blob/Models/SetBlobPropertiesOptionsTest.php similarity index 99% rename from tests/unit/Blob/Models/SetBlobPropertiesOptionsTest.php rename to tests/Unit/Blob/Models/SetBlobPropertiesOptionsTest.php index dc2ce17ac..cee12ea1c 100644 --- a/tests/unit/Blob/Models/SetBlobPropertiesOptionsTest.php +++ b/tests/Unit/Blob/Models/SetBlobPropertiesOptionsTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\SetBlobPropertiesOptions; use MicrosoftAzure\Storage\Blob\Models\AccessCondition; diff --git a/tests/unit/Blob/Models/SetBlobPropertiesResultTest.php b/tests/Unit/Blob/Models/SetBlobPropertiesResultTest.php similarity index 97% rename from tests/unit/Blob/Models/SetBlobPropertiesResultTest.php rename to tests/Unit/Blob/Models/SetBlobPropertiesResultTest.php index 446eba6a7..6ee2ea43a 100644 --- a/tests/unit/Blob/Models/SetBlobPropertiesResultTest.php +++ b/tests/Unit/Blob/Models/SetBlobPropertiesResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Blob\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; use MicrosoftAzure\Storage\Blob\Models\SetBlobPropertiesResult; use MicrosoftAzure\Storage\Common\Internal\Utilities; diff --git a/tests/unit/Blob/Models/SignedIdentifierTest.php b/tests/Unit/Blob/Models/SignedIdentifierTest.php similarity index 98% rename from tests/unit/Blob/Models/SignedIdentifierTest.php rename to tests/Unit/Blob/Models/SignedIdentifierTest.php index 708f5d10d..d91452664 100644 --- a/tests/unit/Blob/Models/SignedIdentifierTest.php +++ b/tests/Unit/Blob/Models/SignedIdentifierTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Models; use MicrosoftAzure\Storage\Common\Models\SignedIdentifier; use MicrosoftAzure\Storage\Common\Models\AccessPolicy; diff --git a/tests/unit/Common/CloudConfigurationManagerTest.php b/tests/Unit/Common/CloudConfigurationManagerTest.php similarity index 99% rename from tests/unit/Common/CloudConfigurationManagerTest.php rename to tests/Unit/Common/CloudConfigurationManagerTest.php index 196fc1c5e..fe1d2dc96 100644 --- a/tests/unit/Common/CloudConfigurationManagerTest.php +++ b/tests/Unit/Common/CloudConfigurationManagerTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common; +namespace MicrosoftAzure\Storage\Tests\Unit\Common; use MicrosoftAzure\Storage\Common\CloudConfigurationManager; use MicrosoftAzure\Storage\Common\Internal\ConnectionStringSource; diff --git a/tests/unit/Common/Exceptions/ServiceExceptionTest.php b/tests/Unit/Common/Exceptions/ServiceExceptionTest.php similarity index 97% rename from tests/unit/Common/Exceptions/ServiceExceptionTest.php rename to tests/Unit/Common/Exceptions/ServiceExceptionTest.php index 86613280a..f445b9bac 100644 --- a/tests/unit/Common/Exceptions/ServiceExceptionTest.php +++ b/tests/Unit/Common/Exceptions/ServiceExceptionTest.php @@ -22,10 +22,10 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Exceptions; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Exceptions; use MicrosoftAzure\Storage\Common\Exceptions\ServiceException; -use MicrosoftAzure\Storage\Tests\framework\TestResources; +use MicrosoftAzure\Storage\Tests\Framework\TestResources; /** * Unit tests for class ServiceException diff --git a/tests/unit/Common/Internal/ACLBaseTest.php b/tests/Unit/Common/Internal/ACLBaseTest.php similarity index 99% rename from tests/unit/Common/Internal/ACLBaseTest.php rename to tests/Unit/Common/Internal/ACLBaseTest.php index 50389808e..aea79db96 100644 --- a/tests/unit/Common/Internal/ACLBaseTest.php +++ b/tests/Unit/Common/Internal/ACLBaseTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Internal; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Internal; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Tests\Framework\ReflectionTestBase; diff --git a/tests/unit/Common/Internal/Authentication/SharedAccessSignatureAuthSchemeTest.php b/tests/Unit/Common/Internal/Authentication/SharedAccessSignatureAuthSchemeTest.php similarity index 97% rename from tests/unit/Common/Internal/Authentication/SharedAccessSignatureAuthSchemeTest.php rename to tests/Unit/Common/Internal/Authentication/SharedAccessSignatureAuthSchemeTest.php index 4059f61e0..3aea950dd 100644 --- a/tests/unit/Common/Internal/Authentication/SharedAccessSignatureAuthSchemeTest.php +++ b/tests/Unit/Common/Internal/Authentication/SharedAccessSignatureAuthSchemeTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Internal\Authentication; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Internal\Authentication; use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Uri; diff --git a/tests/unit/Common/Internal/Authentication/SharedKeyAuthSchemeTest.php b/tests/Unit/Common/Internal/Authentication/SharedKeyAuthSchemeTest.php similarity index 99% rename from tests/unit/Common/Internal/Authentication/SharedKeyAuthSchemeTest.php rename to tests/Unit/Common/Internal/Authentication/SharedKeyAuthSchemeTest.php index 0715419d1..db4213899 100644 --- a/tests/unit/Common/Internal/Authentication/SharedKeyAuthSchemeTest.php +++ b/tests/Unit/Common/Internal/Authentication/SharedKeyAuthSchemeTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Internal\Authentication; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Internal\Authentication; use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Uri; diff --git a/tests/unit/Common/Internal/Authentication/TableSharedKeyLiteAuthSchemeTest.php b/tests/Unit/Common/Internal/Authentication/TableSharedKeyLiteAuthSchemeTest.php similarity index 98% rename from tests/unit/Common/Internal/Authentication/TableSharedKeyLiteAuthSchemeTest.php rename to tests/Unit/Common/Internal/Authentication/TableSharedKeyLiteAuthSchemeTest.php index 06a86a8b4..4c53dbaae 100644 --- a/tests/unit/Common/Internal/Authentication/TableSharedKeyLiteAuthSchemeTest.php +++ b/tests/Unit/Common/Internal/Authentication/TableSharedKeyLiteAuthSchemeTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Internal\Authentication; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Internal\Authentication; use MicrosoftAzure\Storage\Tests\Mock\Common\Internal\Authentication\TableSharedKeyLiteAuthSchemeMock; use MicrosoftAzure\Storage\Common\Internal\Resources; diff --git a/tests/unit/Common/Internal/ConnectionStringParserTest.php b/tests/Unit/Common/Internal/ConnectionStringParserTest.php similarity index 99% rename from tests/unit/Common/Internal/ConnectionStringParserTest.php rename to tests/Unit/Common/Internal/ConnectionStringParserTest.php index 7faa111fc..fd986a697 100644 --- a/tests/unit/Common/Internal/ConnectionStringParserTest.php +++ b/tests/Unit/Common/Internal/ConnectionStringParserTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Internal; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Internal; use MicrosoftAzure\Storage\Common\Internal\ConnectionStringParser; diff --git a/tests/unit/Common/Internal/ConnectionStringSourceTest.php b/tests/Unit/Common/Internal/ConnectionStringSourceTest.php similarity index 97% rename from tests/unit/Common/Internal/ConnectionStringSourceTest.php rename to tests/Unit/Common/Internal/ConnectionStringSourceTest.php index 12999a09d..e21b4b51d 100644 --- a/tests/unit/Common/Internal/ConnectionStringSourceTest.php +++ b/tests/Unit/Common/Internal/ConnectionStringSourceTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Internal; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Internal; use MicrosoftAzure\Storage\Common\Internal\ConnectionStringSource; diff --git a/tests/unit/Common/Internal/Http/HttpCallContextTest.php b/tests/Unit/Common/Internal/Http/HttpCallContextTest.php similarity index 99% rename from tests/unit/Common/Internal/Http/HttpCallContextTest.php rename to tests/Unit/Common/Internal/Http/HttpCallContextTest.php index b5e80b0a8..95ae7c961 100644 --- a/tests/unit/Common/Internal/Http/HttpCallContextTest.php +++ b/tests/Unit/Common/Internal/Http/HttpCallContextTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Internal\Http; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Internal\Http; use MicrosoftAzure\Storage\Common\Internal\Http\HttpCallContext; diff --git a/tests/unit/Common/Internal/InvalidArgumentTypeExceptionTest.php b/tests/Unit/Common/Internal/InvalidArgumentTypeExceptionTest.php similarity index 96% rename from tests/unit/Common/Internal/InvalidArgumentTypeExceptionTest.php rename to tests/Unit/Common/Internal/InvalidArgumentTypeExceptionTest.php index 615d23a0b..77b0e5bfa 100644 --- a/tests/unit/Common/Internal/InvalidArgumentTypeExceptionTest.php +++ b/tests/Unit/Common/Internal/InvalidArgumentTypeExceptionTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Internal; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Internal; use MicrosoftAzure\Storage\Common\Exceptions\InvalidArgumentTypeException; diff --git a/tests/unit/Common/Internal/LoggerTest.php b/tests/Unit/Common/Internal/LoggerTest.php similarity index 97% rename from tests/unit/Common/Internal/LoggerTest.php rename to tests/Unit/Common/Internal/LoggerTest.php index b966304f6..434240d2a 100644 --- a/tests/unit/Common/Internal/LoggerTest.php +++ b/tests/Unit/Common/Internal/LoggerTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Internal; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Internal; use MicrosoftAzure\Storage\Common\Logger; use MicrosoftAzure\Storage\Common\Internal\Resources; diff --git a/tests/unit/Common/Internal/Middlewares/CommonRequestMiddlewareTest.php b/tests/Unit/Common/Internal/Middlewares/CommonRequestMiddlewareTest.php similarity index 98% rename from tests/unit/Common/Internal/Middlewares/CommonRequestMiddlewareTest.php rename to tests/Unit/Common/Internal/Middlewares/CommonRequestMiddlewareTest.php index 75ca4549f..1b39ac961 100644 --- a/tests/unit/Common/Internal/Middlewares/CommonRequestMiddlewareTest.php +++ b/tests/Unit/Common/Internal/Middlewares/CommonRequestMiddlewareTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Internal\Middlewares; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Internal\Middlewares; use MicrosoftAzure\Storage\Common\Internal\Middlewares\CommonRequestMiddleware; use MicrosoftAzure\Storage\Common\Internal\Authentication\SharedKeyAuthScheme; diff --git a/tests/unit/Common/Internal/Serialization/DummyClass.php b/tests/Unit/Common/Internal/Serialization/DummyClass.php similarity index 96% rename from tests/unit/Common/Internal/Serialization/DummyClass.php rename to tests/Unit/Common/Internal/Serialization/DummyClass.php index a812b34ce..b6910e606 100644 --- a/tests/unit/Common/Internal/Serialization/DummyClass.php +++ b/tests/Unit/Common/Internal/Serialization/DummyClass.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Internal\Serialization; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Internal\Serialization; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Internal\Serialization\XmlSerializer; diff --git a/tests/unit/Common/Internal/Serialization/JsonSerializerTest.php b/tests/Unit/Common/Internal/Serialization/JsonSerializerTest.php similarity index 98% rename from tests/unit/Common/Internal/Serialization/JsonSerializerTest.php rename to tests/Unit/Common/Internal/Serialization/JsonSerializerTest.php index 7fd57b71d..746596f3b 100644 --- a/tests/unit/Common/Internal/Serialization/JsonSerializerTest.php +++ b/tests/Unit/Common/Internal/Serialization/JsonSerializerTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Internal\Serialization; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Internal\Serialization; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Models\ServiceProperties; diff --git a/tests/unit/Common/Internal/Serialization/XmlSerializerTest.php b/tests/Unit/Common/Internal/Serialization/XmlSerializerTest.php similarity index 98% rename from tests/unit/Common/Internal/Serialization/XmlSerializerTest.php rename to tests/Unit/Common/Internal/Serialization/XmlSerializerTest.php index 700428542..d40aa4a4c 100644 --- a/tests/unit/Common/Internal/Serialization/XmlSerializerTest.php +++ b/tests/Unit/Common/Internal/Serialization/XmlSerializerTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Internal\Serialization; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Internal\Serialization; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Models\ServiceProperties; diff --git a/tests/unit/Common/Internal/ServiceOptionsTest.php b/tests/Unit/Common/Internal/ServiceOptionsTest.php similarity index 97% rename from tests/unit/Common/Internal/ServiceOptionsTest.php rename to tests/Unit/Common/Internal/ServiceOptionsTest.php index bc7fb97f2..9eb31075f 100644 --- a/tests/unit/Common/Internal/ServiceOptionsTest.php +++ b/tests/Unit/Common/Internal/ServiceOptionsTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common; +namespace MicrosoftAzure\Storage\Tests\Unit\Common; use MicrosoftAzure\Storage\Common\Models\ServiceOptions; diff --git a/tests/unit/Common/Internal/ServiceRestProxyTest.php b/tests/Unit/Common/Internal/ServiceRestProxyTest.php similarity index 99% rename from tests/unit/Common/Internal/ServiceRestProxyTest.php rename to tests/Unit/Common/Internal/ServiceRestProxyTest.php index ad7ed894f..44b6fd5bf 100644 --- a/tests/unit/Common/Internal/ServiceRestProxyTest.php +++ b/tests/Unit/Common/Internal/ServiceRestProxyTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Internal; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Internal; use GuzzleHttp\Exception\RequestException; use GuzzleHttp\Handler\MockHandler; diff --git a/tests/unit/Common/Internal/StorageServiceSettingsTest.php b/tests/Unit/Common/Internal/StorageServiceSettingsTest.php similarity index 99% rename from tests/unit/Common/Internal/StorageServiceSettingsTest.php rename to tests/Unit/Common/Internal/StorageServiceSettingsTest.php index bb2a55443..86dcf6066 100644 --- a/tests/unit/Common/Internal/StorageServiceSettingsTest.php +++ b/tests/Unit/Common/Internal/StorageServiceSettingsTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Internal; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Internal; use MicrosoftAzure\Storage\Common\Internal\StorageServiceSettings; use MicrosoftAzure\Storage\Common\Internal\Resources; diff --git a/tests/unit/Common/Internal/UtilitiesTest.php b/tests/Unit/Common/Internal/UtilitiesTest.php similarity index 99% rename from tests/unit/Common/Internal/UtilitiesTest.php rename to tests/Unit/Common/Internal/UtilitiesTest.php index 39a5a62f9..6c7975f82 100644 --- a/tests/unit/Common/Internal/UtilitiesTest.php +++ b/tests/Unit/Common/Internal/UtilitiesTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Internal; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Internal; use MicrosoftAzure\Storage\Common\Internal\Utilities; use MicrosoftAzure\Storage\Common\Internal\Resources; diff --git a/tests/unit/Common/Internal/ValidateTest.php b/tests/Unit/Common/Internal/ValidateTest.php similarity index 99% rename from tests/unit/Common/Internal/ValidateTest.php rename to tests/Unit/Common/Internal/ValidateTest.php index bea70ffcd..9286685ca 100644 --- a/tests/unit/Common/Internal/ValidateTest.php +++ b/tests/Unit/Common/Internal/ValidateTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Internal; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Internal; use MicrosoftAzure\Storage\Common\Internal\Validate; use MicrosoftAzure\Storage\Common\Exceptions\InvalidArgumentTypeException; diff --git a/tests/unit/Common/Middlewares/HistoryMiddlewareTest.php b/tests/Unit/Common/Middlewares/HistoryMiddlewareTest.php similarity index 98% rename from tests/unit/Common/Middlewares/HistoryMiddlewareTest.php rename to tests/Unit/Common/Middlewares/HistoryMiddlewareTest.php index 86c1121ca..a9670a289 100644 --- a/tests/unit/Common/Middlewares/HistoryMiddlewareTest.php +++ b/tests/Unit/Common/Middlewares/HistoryMiddlewareTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Middlewares; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Middlewares; use MicrosoftAzure\Storage\Common\Middlewares\HistoryMiddleware; use MicrosoftAzure\Storage\Tests\Framework\ReflectionTestBase; diff --git a/tests/unit/Common/Middlewares/MiddlewareBaseTest.php b/tests/Unit/Common/Middlewares/MiddlewareBaseTest.php similarity index 98% rename from tests/unit/Common/Middlewares/MiddlewareBaseTest.php rename to tests/Unit/Common/Middlewares/MiddlewareBaseTest.php index f5a8e7c13..7efa4ff76 100644 --- a/tests/unit/Common/Middlewares/MiddlewareBaseTest.php +++ b/tests/Unit/Common/Middlewares/MiddlewareBaseTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Middlewares; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Middlewares; use MicrosoftAzure\Storage\Common\Middlewares\MiddlewareBase; use MicrosoftAzure\Storage\Tests\Framework\ReflectionTestBase; diff --git a/tests/unit/Common/Middlewares/MiddlewareStackTest.php b/tests/Unit/Common/Middlewares/MiddlewareStackTest.php similarity index 97% rename from tests/unit/Common/Middlewares/MiddlewareStackTest.php rename to tests/Unit/Common/Middlewares/MiddlewareStackTest.php index 3d8dd284f..cbd509405 100644 --- a/tests/unit/Common/Middlewares/MiddlewareStackTest.php +++ b/tests/Unit/Common/Middlewares/MiddlewareStackTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Middlewares; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Middlewares; use MicrosoftAzure\Storage\Common\Middlewares\MiddlewareStack; diff --git a/tests/unit/Common/Middlewares/RetryMiddlewareFactoryTest.php b/tests/Unit/Common/Middlewares/RetryMiddlewareFactoryTest.php similarity index 98% rename from tests/unit/Common/Middlewares/RetryMiddlewareFactoryTest.php rename to tests/Unit/Common/Middlewares/RetryMiddlewareFactoryTest.php index 9d7b113b3..3344db8a4 100644 --- a/tests/unit/Common/Middlewares/RetryMiddlewareFactoryTest.php +++ b/tests/Unit/Common/Middlewares/RetryMiddlewareFactoryTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Middlewares; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Middlewares; use MicrosoftAzure\Storage\Common\Middlewares\RetryMiddlewareFactory; use MicrosoftAzure\Storage\Common\Internal\Resources; diff --git a/tests/unit/Common/Models/AccessPolicyTest.php b/tests/Unit/Common/Models/AccessPolicyTest.php similarity index 98% rename from tests/unit/Common/Models/AccessPolicyTest.php rename to tests/Unit/Common/Models/AccessPolicyTest.php index 0c6461438..3d7d2855c 100644 --- a/tests/unit/Common/Models/AccessPolicyTest.php +++ b/tests/Unit/Common/Models/AccessPolicyTest.php @@ -21,10 +21,10 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Models; use MicrosoftAzure\Storage\Common\Models\AccessPolicy; -use MicrosoftAzure\Storage\Tests\framework\TestResources; +use MicrosoftAzure\Storage\Tests\Framework\TestResources; /** * Unit tests for class AccessPolicy diff --git a/tests/unit/Common/Models/CORSTest.php b/tests/Unit/Common/Models/CORSTest.php similarity index 98% rename from tests/unit/Common/Models/CORSTest.php rename to tests/Unit/Common/Models/CORSTest.php index c62a94af3..99ca6d148 100644 --- a/tests/unit/Common/Models/CORSTest.php +++ b/tests/Unit/Common/Models/CORSTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Models; use MicrosoftAzure\Storage\Common\Models\CORS; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Common/Models/GetServicePropertiesResultTest.php b/tests/Unit/Common/Models/GetServicePropertiesResultTest.php similarity index 97% rename from tests/unit/Common/Models/GetServicePropertiesResultTest.php rename to tests/Unit/Common/Models/GetServicePropertiesResultTest.php index 3de0dbfb8..78538eb10 100644 --- a/tests/unit/Common/Models/GetServicePropertiesResultTest.php +++ b/tests/Unit/Common/Models/GetServicePropertiesResultTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Models; use MicrosoftAzure\Storage\Common\Models\GetServicePropertiesResult; use MicrosoftAzure\Storage\Common\Models\ServiceProperties; diff --git a/tests/unit/Common/Models/GetServiceStatsResultTest.php b/tests/Unit/Common/Models/GetServiceStatsResultTest.php similarity index 97% rename from tests/unit/Common/Models/GetServiceStatsResultTest.php rename to tests/Unit/Common/Models/GetServiceStatsResultTest.php index 96ef751ca..272327cfc 100644 --- a/tests/unit/Common/Models/GetServiceStatsResultTest.php +++ b/tests/Unit/Common/Models/GetServiceStatsResultTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Models; use MicrosoftAzure\Storage\Common\Models\GetServiceStatsResult; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Common/Models/LoggingTest.php b/tests/Unit/Common/Models/LoggingTest.php similarity index 99% rename from tests/unit/Common/Models/LoggingTest.php rename to tests/Unit/Common/Models/LoggingTest.php index 7e4655fc9..8ae10fe45 100644 --- a/tests/unit/Common/Models/LoggingTest.php +++ b/tests/Unit/Common/Models/LoggingTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Models; use MicrosoftAzure\Storage\Common\Models\Logging; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Common/Models/MetricsTest.php b/tests/Unit/Common/Models/MetricsTest.php similarity index 99% rename from tests/unit/Common/Models/MetricsTest.php rename to tests/Unit/Common/Models/MetricsTest.php index a3a82b0ed..738473608 100644 --- a/tests/unit/Common/Models/MetricsTest.php +++ b/tests/Unit/Common/Models/MetricsTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Models; use MicrosoftAzure\Storage\Common\Models\Metrics; use MicrosoftAzure\Storage\Common\Internal\Utilities; diff --git a/tests/unit/Common/Models/RangeDiffTest.php b/tests/Unit/Common/Models/RangeDiffTest.php similarity index 97% rename from tests/unit/Common/Models/RangeDiffTest.php rename to tests/Unit/Common/Models/RangeDiffTest.php index a331c0dd3..507b338e3 100644 --- a/tests/unit/Common/Models/RangeDiffTest.php +++ b/tests/Unit/Common/Models/RangeDiffTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Models; use MicrosoftAzure\Storage\Common\Models\RangeDiff; diff --git a/tests/unit/Common/Models/RangeTest.php b/tests/Unit/Common/Models/RangeTest.php similarity index 98% rename from tests/unit/Common/Models/RangeTest.php rename to tests/Unit/Common/Models/RangeTest.php index dfb18c161..e55786071 100644 --- a/tests/unit/Common/Models/RangeTest.php +++ b/tests/Unit/Common/Models/RangeTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Models; use MicrosoftAzure\Storage\Common\Models\Range; diff --git a/tests/unit/Common/Models/RetentionPolicyTest.php b/tests/Unit/Common/Models/RetentionPolicyTest.php similarity index 98% rename from tests/unit/Common/Models/RetentionPolicyTest.php rename to tests/Unit/Common/Models/RetentionPolicyTest.php index 460ab35bb..a7b2c1f22 100644 --- a/tests/unit/Common/Models/RetentionPolicyTest.php +++ b/tests/Unit/Common/Models/RetentionPolicyTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Models; use MicrosoftAzure\Storage\Common\Models\RetentionPolicy; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Common/Models/ServicePropertiesTest.php b/tests/Unit/Common/Models/ServicePropertiesTest.php similarity index 99% rename from tests/unit/Common/Models/ServicePropertiesTest.php rename to tests/Unit/Common/Models/ServicePropertiesTest.php index 9e0a94c1b..14f29dcd6 100644 --- a/tests/unit/Common/Models/ServicePropertiesTest.php +++ b/tests/Unit/Common/Models/ServicePropertiesTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Common\Models; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Internal\Utilities; diff --git a/tests/unit/Common/ServicesBuilderTest.php b/tests/Unit/Common/ServicesBuilderTest.php similarity index 99% rename from tests/unit/Common/ServicesBuilderTest.php rename to tests/Unit/Common/ServicesBuilderTest.php index b12525ff7..ef69123a0 100644 --- a/tests/unit/Common/ServicesBuilderTest.php +++ b/tests/Unit/Common/ServicesBuilderTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common; +namespace MicrosoftAzure\Storage\Tests\Unit\Common; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Internal\Resources; diff --git a/tests/unit/Common/SharedAccessSignatureHelperTest.php b/tests/Unit/Common/SharedAccessSignatureHelperTest.php similarity index 98% rename from tests/unit/Common/SharedAccessSignatureHelperTest.php rename to tests/Unit/Common/SharedAccessSignatureHelperTest.php index 70a38daea..8bb984180 100644 --- a/tests/unit/Common/SharedAccessSignatureHelperTest.php +++ b/tests/Unit/Common/SharedAccessSignatureHelperTest.php @@ -22,11 +22,11 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Common; +namespace MicrosoftAzure\Storage\Tests\Unit\Common; use MicrosoftAzure\Storage\Common\Internal\Resources; use MicrosoftAzure\Storage\Common\ServiceException; -use MicrosoftAzure\Storage\Tests\framework\TestResources; +use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Tests\Framework\ReflectionTestBase; use MicrosoftAzure\Storage\Common\SharedAccessSignatureHelper; diff --git a/tests/unit/File/FileRestProxyTest.php b/tests/Unit/File/FileRestProxyTest.php similarity index 99% rename from tests/unit/File/FileRestProxyTest.php rename to tests/Unit/File/FileRestProxyTest.php index 3c810f90b..56482cf0f 100644 --- a/tests/unit/File/FileRestProxyTest.php +++ b/tests/Unit/File/FileRestProxyTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\File; +namespace MicrosoftAzure\Storage\Tests\Unit\File; use MicrosoftAzure\Storage\Tests\Framework\VirtualFileSystem; use MicrosoftAzure\Storage\Tests\Framework\FileServiceRestProxyTestBase; @@ -37,7 +37,7 @@ use MicrosoftAzure\Storage\File\Models\ListSharesResult; use MicrosoftAzure\Storage\File\Models\CreateShareOptions; use MicrosoftAzure\Storage\File\Models\GetSharePropertiesResult; -use MicrosoftAzure\Storage\File\Models\ShareAcl; +use MicrosoftAzure\Storage\File\Models\ShareACL; use MicrosoftAzure\Storage\File\Models\ListDirectoriesAndFilesResult; use MicrosoftAzure\Storage\File\Models\ListDirectoriesAndFilesOptions; use MicrosoftAzure\Storage\File\Models\ListFileBlocksOptions; diff --git a/tests/unit/File/Models/DirectoryTest.php b/tests/Unit/File/Models/DirectoryTest.php similarity index 97% rename from tests/unit/File/Models/DirectoryTest.php rename to tests/Unit/File/Models/DirectoryTest.php index 58a8bcc33..a3eb6a7c4 100644 --- a/tests/unit/File/Models/DirectoryTest.php +++ b/tests/Unit/File/Models/DirectoryTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\File\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\File\Models; use MicrosoftAzure\Storage\File\Models\Directory; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/File/Models/FileTest.php b/tests/Unit/File/Models/FileTest.php similarity index 97% rename from tests/unit/File/Models/FileTest.php rename to tests/Unit/File/Models/FileTest.php index 61d894a4e..ed2d24c02 100644 --- a/tests/unit/File/Models/FileTest.php +++ b/tests/Unit/File/Models/FileTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\File\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\File\Models; use MicrosoftAzure\Storage\File\Models\File; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/File/Models/GetDirectoryPropertiesResultTest.php b/tests/Unit/File/Models/GetDirectoryPropertiesResultTest.php similarity index 98% rename from tests/unit/File/Models/GetDirectoryPropertiesResultTest.php rename to tests/Unit/File/Models/GetDirectoryPropertiesResultTest.php index a0e8bbab4..b68e33a9a 100644 --- a/tests/unit/File/Models/GetDirectoryPropertiesResultTest.php +++ b/tests/Unit/File/Models/GetDirectoryPropertiesResultTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\File\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\File\Models; use MicrosoftAzure\Storage\File\Models\GetDirectoryPropertiesResult; use MicrosoftAzure\Storage\Common\Internal\Resources; diff --git a/tests/unit/File/Models/GetSharePropertiesResultTest.php b/tests/Unit/File/Models/GetSharePropertiesResultTest.php similarity index 98% rename from tests/unit/File/Models/GetSharePropertiesResultTest.php rename to tests/Unit/File/Models/GetSharePropertiesResultTest.php index e3bb54f89..7fb0aff5b 100644 --- a/tests/unit/File/Models/GetSharePropertiesResultTest.php +++ b/tests/Unit/File/Models/GetSharePropertiesResultTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\File\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\File\Models; use MicrosoftAzure\Storage\File\Models\GetSharePropertiesResult; use MicrosoftAzure\Storage\Common\Internal\Resources; diff --git a/tests/unit/File/Models/ListDirectoriesAndFilesResultTest.php b/tests/Unit/File/Models/ListDirectoriesAndFilesResultTest.php similarity index 98% rename from tests/unit/File/Models/ListDirectoriesAndFilesResultTest.php rename to tests/Unit/File/Models/ListDirectoriesAndFilesResultTest.php index 9496c6e18..07708a773 100644 --- a/tests/unit/File/Models/ListDirectoriesAndFilesResultTest.php +++ b/tests/Unit/File/Models/ListDirectoriesAndFilesResultTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\File\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\File\Models; use MicrosoftAzure\Storage\File\Models\ListDirectoriesAndFilesResult; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/File/Models/ListSharesResultTest.php b/tests/Unit/File/Models/ListSharesResultTest.php similarity index 98% rename from tests/unit/File/Models/ListSharesResultTest.php rename to tests/Unit/File/Models/ListSharesResultTest.php index 4a3653a14..ecf210141 100644 --- a/tests/unit/File/Models/ListSharesResultTest.php +++ b/tests/Unit/File/Models/ListSharesResultTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\File\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\File\Models; use MicrosoftAzure\Storage\File\Models\ListSharesResult; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/File/Models/SharePropertiesTest.php b/tests/Unit/File/Models/SharePropertiesTest.php similarity index 95% rename from tests/unit/File/Models/SharePropertiesTest.php rename to tests/Unit/File/Models/SharePropertiesTest.php index 26fe90fdb..eed65b636 100644 --- a/tests/unit/File/Models/SharePropertiesTest.php +++ b/tests/Unit/File/Models/SharePropertiesTest.php @@ -22,10 +22,10 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\File\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\File\Models; use MicrosoftAzure\Storage\File\Models\ShareProperties; -use MicrosoftAzure\Storage\Tests\framework\TestResources; +use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Internal\Utilities; use MicrosoftAzure\Storage\Common\Internal\Resources; diff --git a/tests/unit/File/Models/ShareTest.php b/tests/Unit/File/Models/ShareTest.php similarity index 95% rename from tests/unit/File/Models/ShareTest.php rename to tests/Unit/File/Models/ShareTest.php index 79ee2bd29..cc7e5db4c 100644 --- a/tests/unit/File/Models/ShareTest.php +++ b/tests/Unit/File/Models/ShareTest.php @@ -22,11 +22,11 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\File\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\File\Models; use MicrosoftAzure\Storage\File\Models\ShareProperties; use MicrosoftAzure\Storage\File\Models\Share; -use MicrosoftAzure\Storage\Tests\framework\TestResources; +use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Internal\Utilities; use MicrosoftAzure\Storage\Common\Internal\Resources; diff --git a/tests/unit/Queue/Models/CreateMessageOptionsTest.php b/tests/Unit/Queue/Models/CreateMessageOptionsTest.php similarity index 98% rename from tests/unit/Queue/Models/CreateMessageOptionsTest.php rename to tests/Unit/Queue/Models/CreateMessageOptionsTest.php index 5d0813906..67e27f929 100644 --- a/tests/unit/Queue/Models/CreateMessageOptionsTest.php +++ b/tests/Unit/Queue/Models/CreateMessageOptionsTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Queue\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Queue\Models; use MicrosoftAzure\Storage\Queue\Models\CreateMessageOptions; diff --git a/tests/unit/Queue/Models/CreateQueueOptionsTest.php b/tests/Unit/Queue/Models/CreateQueueOptionsTest.php similarity index 97% rename from tests/unit/Queue/Models/CreateQueueOptionsTest.php rename to tests/Unit/Queue/Models/CreateQueueOptionsTest.php index bc315beb7..8b2b2e197 100644 --- a/tests/unit/Queue/Models/CreateQueueOptionsTest.php +++ b/tests/Unit/Queue/Models/CreateQueueOptionsTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Queue\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Queue\Models; use MicrosoftAzure\Storage\Queue\Models\CreateQueueOptions; diff --git a/tests/unit/Queue/Models/GetQueueMetadataResultTest.php b/tests/Unit/Queue/Models/GetQueueMetadataResultTest.php similarity index 97% rename from tests/unit/Queue/Models/GetQueueMetadataResultTest.php rename to tests/Unit/Queue/Models/GetQueueMetadataResultTest.php index 86989bbeb..6708af15d 100644 --- a/tests/unit/Queue/Models/GetQueueMetadataResultTest.php +++ b/tests/Unit/Queue/Models/GetQueueMetadataResultTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Queue\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Queue\Models; use MicrosoftAzure\Storage\Queue\Models\GetQueueMetadataResult; diff --git a/tests/unit/Queue/Models/ListMessagesOptionsTest.php b/tests/Unit/Queue/Models/ListMessagesOptionsTest.php similarity index 98% rename from tests/unit/Queue/Models/ListMessagesOptionsTest.php rename to tests/Unit/Queue/Models/ListMessagesOptionsTest.php index 9d7067487..d7489fa2a 100644 --- a/tests/unit/Queue/Models/ListMessagesOptionsTest.php +++ b/tests/Unit/Queue/Models/ListMessagesOptionsTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Queue\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Queue\Models; use MicrosoftAzure\Storage\Queue\Models\ListMessagesOptions; diff --git a/tests/unit/Queue/Models/ListMessagesResultTest.php b/tests/Unit/Queue/Models/ListMessagesResultTest.php similarity index 98% rename from tests/unit/Queue/Models/ListMessagesResultTest.php rename to tests/Unit/Queue/Models/ListMessagesResultTest.php index 65a3a47dc..c24b0f663 100644 --- a/tests/unit/Queue/Models/ListMessagesResultTest.php +++ b/tests/Unit/Queue/Models/ListMessagesResultTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Queue\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Queue\Models; use MicrosoftAzure\Storage\Queue\Models\ListMessagesResult; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Queue/Models/ListQueuesOptionsTest.php b/tests/Unit/Queue/Models/ListQueuesOptionsTest.php similarity index 98% rename from tests/unit/Queue/Models/ListQueuesOptionsTest.php rename to tests/Unit/Queue/Models/ListQueuesOptionsTest.php index 49c392ff9..1d0998789 100644 --- a/tests/unit/Queue/Models/ListQueuesOptionsTest.php +++ b/tests/Unit/Queue/Models/ListQueuesOptionsTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Queue\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Queue\Models; use MicrosoftAzure\Storage\Queue\Models\ListQueuesOptions; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Queue/Models/ListQueuesResultTest.php b/tests/Unit/Queue/Models/ListQueuesResultTest.php similarity index 98% rename from tests/unit/Queue/Models/ListQueuesResultTest.php rename to tests/Unit/Queue/Models/ListQueuesResultTest.php index 9628d2793..2d3d52cd5 100644 --- a/tests/unit/Queue/Models/ListQueuesResultTest.php +++ b/tests/Unit/Queue/Models/ListQueuesResultTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Queue\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Queue\Models; use MicrosoftAzure\Storage\Queue\Models\ListQueuesResult; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Queue/Models/PeekMessagesOptionsTest.php b/tests/Unit/Queue/Models/PeekMessagesOptionsTest.php similarity index 97% rename from tests/unit/Queue/Models/PeekMessagesOptionsTest.php rename to tests/Unit/Queue/Models/PeekMessagesOptionsTest.php index 9abcc8c51..1bf2274d8 100644 --- a/tests/unit/Queue/Models/PeekMessagesOptionsTest.php +++ b/tests/Unit/Queue/Models/PeekMessagesOptionsTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Queue\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Queue\Models; use MicrosoftAzure\Storage\Queue\Models\PeekMessagesOptions; diff --git a/tests/unit/Queue/Models/PeekMessagesResultTest.php b/tests/Unit/Queue/Models/PeekMessagesResultTest.php similarity index 98% rename from tests/unit/Queue/Models/PeekMessagesResultTest.php rename to tests/Unit/Queue/Models/PeekMessagesResultTest.php index 40a916950..ae0dcded6 100644 --- a/tests/unit/Queue/Models/PeekMessagesResultTest.php +++ b/tests/Unit/Queue/Models/PeekMessagesResultTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Queue\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Queue\Models; use MicrosoftAzure\Storage\Queue\Models\PeekMessagesResult; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Queue/Models/QueueACLTest.php b/tests/Unit/Queue/Models/QueueACLTest.php similarity index 98% rename from tests/unit/Queue/Models/QueueACLTest.php rename to tests/Unit/Queue/Models/QueueACLTest.php index 9827f1f62..f7013d3c1 100644 --- a/tests/unit/Queue/Models/QueueACLTest.php +++ b/tests/Unit/Queue/Models/QueueACLTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Queue\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Queue\Models; use MicrosoftAzure\Storage\Queue\Models\QueueACL; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Queue/Models/QueueMessageTest.php b/tests/Unit/Queue/Models/QueueMessageTest.php similarity index 99% rename from tests/unit/Queue/Models/QueueMessageTest.php rename to tests/Unit/Queue/Models/QueueMessageTest.php index b5d05761c..c44ee3da4 100644 --- a/tests/unit/Queue/Models/QueueMessageTest.php +++ b/tests/Unit/Queue/Models/QueueMessageTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Queue\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Queue\Models; use MicrosoftAzure\Storage\Common\Internal\Utilities; use MicrosoftAzure\Storage\Queue\Models\QueueMessage; diff --git a/tests/unit/Queue/Models/QueueTest.php b/tests/Unit/Queue/Models/QueueTest.php similarity index 98% rename from tests/unit/Queue/Models/QueueTest.php rename to tests/Unit/Queue/Models/QueueTest.php index d136b7586..89e66bea1 100644 --- a/tests/unit/Queue/Models/QueueTest.php +++ b/tests/Unit/Queue/Models/QueueTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Queue\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Queue\Models; use MicrosoftAzure\Storage\Queue\Models\Queue; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Queue/Models/UpdateMessageResultTest.php b/tests/Unit/Queue/Models/UpdateMessageResultTest.php similarity index 97% rename from tests/unit/Queue/Models/UpdateMessageResultTest.php rename to tests/Unit/Queue/Models/UpdateMessageResultTest.php index 65302ac24..970c8ad84 100644 --- a/tests/unit/Queue/Models/UpdateMessageResultTest.php +++ b/tests/Unit/Queue/Models/UpdateMessageResultTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Queue\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Queue\Models; use MicrosoftAzure\Storage\Queue\Models\UpdateMessageResult; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Queue/QueueRestProxyTest.php b/tests/Unit/Queue/QueueRestProxyTest.php similarity index 99% rename from tests/unit/Queue/QueueRestProxyTest.php rename to tests/Unit/Queue/QueueRestProxyTest.php index 69029ac9a..f7812dc4c 100644 --- a/tests/unit/Queue/QueueRestProxyTest.php +++ b/tests/Unit/Queue/QueueRestProxyTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Queue; +namespace MicrosoftAzure\Storage\Tests\Unit\Queue; use MicrosoftAzure\Storage\Common\Internal\Utilities; use MicrosoftAzure\Storage\Tests\Framework\QueueServiceRestProxyTestBase; diff --git a/tests/unit/Table/Internal/JsonODataReaderWriterTest.php b/tests/Unit/Table/Internal/JsonODataReaderWriterTest.php similarity index 100% rename from tests/unit/Table/Internal/JsonODataReaderWriterTest.php rename to tests/Unit/Table/Internal/JsonODataReaderWriterTest.php diff --git a/tests/unit/Table/Models/BatchOperationParameterNameTest.php b/tests/Unit/Table/Models/BatchOperationParameterNameTest.php similarity index 97% rename from tests/unit/Table/Models/BatchOperationParameterNameTest.php rename to tests/Unit/Table/Models/BatchOperationParameterNameTest.php index 4281bdfbb..8f231e5d0 100644 --- a/tests/unit/Table/Models/BatchOperationParameterNameTest.php +++ b/tests/Unit/Table/Models/BatchOperationParameterNameTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models; use MicrosoftAzure\Storage\Table\Models\BatchOperationParameterName; diff --git a/tests/unit/Table/Models/BatchOperationTest.php b/tests/Unit/Table/Models/BatchOperationTest.php similarity index 97% rename from tests/unit/Table/Models/BatchOperationTest.php rename to tests/Unit/Table/Models/BatchOperationTest.php index dcbcb8e7d..fb51c7a8d 100644 --- a/tests/unit/Table/Models/BatchOperationTest.php +++ b/tests/Unit/Table/Models/BatchOperationTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models; use MicrosoftAzure\Storage\Table\Models\BatchOperation; use MicrosoftAzure\Storage\Table\Models\BatchOperationType; diff --git a/tests/unit/Table/Models/BatchOperationTypeTest.php b/tests/Unit/Table/Models/BatchOperationTypeTest.php similarity index 97% rename from tests/unit/Table/Models/BatchOperationTypeTest.php rename to tests/Unit/Table/Models/BatchOperationTypeTest.php index ff52baf99..012264155 100644 --- a/tests/unit/Table/Models/BatchOperationTypeTest.php +++ b/tests/Unit/Table/Models/BatchOperationTypeTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models; use MicrosoftAzure\Storage\Table\Models\BatchOperationType; diff --git a/tests/unit/Table/Models/BatchOperationsTest.php b/tests/Unit/Table/Models/BatchOperationsTest.php similarity index 99% rename from tests/unit/Table/Models/BatchOperationsTest.php rename to tests/Unit/Table/Models/BatchOperationsTest.php index bddf13dd8..ab94fd17b 100644 --- a/tests/unit/Table/Models/BatchOperationsTest.php +++ b/tests/Unit/Table/Models/BatchOperationsTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models; use MicrosoftAzure\Storage\Table\Models\BatchOperations; use MicrosoftAzure\Storage\Table\Models\BatchOperation; diff --git a/tests/unit/Table/Models/BatchResultTest.php b/tests/Unit/Table/Models/BatchResultTest.php similarity index 97% rename from tests/unit/Table/Models/BatchResultTest.php rename to tests/Unit/Table/Models/BatchResultTest.php index 14f10418b..4cc051231 100644 --- a/tests/unit/Table/Models/BatchResultTest.php +++ b/tests/Unit/Table/Models/BatchResultTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models; use MicrosoftAzure\Storage\Table\Models\BatchResult; use MicrosoftAzure\Storage\Table\Internal\MimeReaderWriter; diff --git a/tests/unit/Table/Models/DeleteEntityOptionsTest.php b/tests/Unit/Table/Models/DeleteEntityOptionsTest.php similarity index 96% rename from tests/unit/Table/Models/DeleteEntityOptionsTest.php rename to tests/Unit/Table/Models/DeleteEntityOptionsTest.php index 7489f6132..7dd1c65ea 100644 --- a/tests/unit/Table/Models/DeleteEntityOptionsTest.php +++ b/tests/Unit/Table/Models/DeleteEntityOptionsTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models; use MicrosoftAzure\Storage\Table\Models\DeleteEntityOptions; use MicrosoftAzure\Storage\Table\Models\ETag; diff --git a/tests/unit/Table/Models/EdmTypeTest.php b/tests/Unit/Table/Models/EdmTypeTest.php similarity index 99% rename from tests/unit/Table/Models/EdmTypeTest.php rename to tests/Unit/Table/Models/EdmTypeTest.php index c8ba24389..b6a4d26de 100644 --- a/tests/unit/Table/Models/EdmTypeTest.php +++ b/tests/Unit/Table/Models/EdmTypeTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models; use MicrosoftAzure\Storage\Table\Models\EdmType; use MicrosoftAzure\Storage\Common\Internal\Utilities; diff --git a/tests/unit/Table/Models/EntityTest.php b/tests/Unit/Table/Models/EntityTest.php similarity index 99% rename from tests/unit/Table/Models/EntityTest.php rename to tests/Unit/Table/Models/EntityTest.php index c60c598e0..54cb3cc69 100644 --- a/tests/unit/Table/Models/EntityTest.php +++ b/tests/Unit/Table/Models/EntityTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models; use MicrosoftAzure\Storage\Table\Models\Entity; use MicrosoftAzure\Storage\Table\Models\Property; diff --git a/tests/unit/Table/Models/Filters/BinaryFilterTest.php b/tests/Unit/Table/Models/Filters/BinaryFilterTest.php similarity index 97% rename from tests/unit/Table/Models/Filters/BinaryFilterTest.php rename to tests/Unit/Table/Models/Filters/BinaryFilterTest.php index e950a7cf3..ab6fe90e8 100644 --- a/tests/unit/Table/Models/Filters/BinaryFilterTest.php +++ b/tests/Unit/Table/Models/Filters/BinaryFilterTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models\Filters; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models\Filters; use MicrosoftAzure\Storage\Table\Models\Filters\BinaryFilter; diff --git a/tests/unit/Table/Models/Filters/ConstantFilterTest.php b/tests/Unit/Table/Models/Filters/ConstantFilterTest.php similarity index 97% rename from tests/unit/Table/Models/Filters/ConstantFilterTest.php rename to tests/Unit/Table/Models/Filters/ConstantFilterTest.php index e8fa33c78..164340572 100644 --- a/tests/unit/Table/Models/Filters/ConstantFilterTest.php +++ b/tests/Unit/Table/Models/Filters/ConstantFilterTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models\Filters; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models\Filters; use MicrosoftAzure\Storage\Table\Models\Filters\ConstantFilter; use MicrosoftAzure\Storage\Table\Models\EdmType; diff --git a/tests/unit/Table/Models/Filters/FilterTest.php b/tests/Unit/Table/Models/Filters/FilterTest.php similarity index 99% rename from tests/unit/Table/Models/Filters/FilterTest.php rename to tests/Unit/Table/Models/Filters/FilterTest.php index 1624bedd2..36d5e85df 100644 --- a/tests/unit/Table/Models/Filters/FilterTest.php +++ b/tests/Unit/Table/Models/Filters/FilterTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models\Filters; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models\Filters; use MicrosoftAzure\Storage\Table\Models\Filters\Filter; use MicrosoftAzure\Storage\Table\Models\EdmType; diff --git a/tests/unit/Table/Models/Filters/PropertyNameFilterTest.php b/tests/Unit/Table/Models/Filters/PropertyNameFilterTest.php similarity index 96% rename from tests/unit/Table/Models/Filters/PropertyNameFilterTest.php rename to tests/Unit/Table/Models/Filters/PropertyNameFilterTest.php index fa4611ccf..1d470dd9b 100644 --- a/tests/unit/Table/Models/Filters/PropertyNameFilterTest.php +++ b/tests/Unit/Table/Models/Filters/PropertyNameFilterTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models\Filters; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models\Filters; use MicrosoftAzure\Storage\Table\Models\Filters\PropertyNameFilter; diff --git a/tests/unit/Table/Models/Filters/QueryStringFilterTest.php b/tests/Unit/Table/Models/Filters/QueryStringFilterTest.php similarity index 96% rename from tests/unit/Table/Models/Filters/QueryStringFilterTest.php rename to tests/Unit/Table/Models/Filters/QueryStringFilterTest.php index c8cd525d2..be56c2a73 100644 --- a/tests/unit/Table/Models/Filters/QueryStringFilterTest.php +++ b/tests/Unit/Table/Models/Filters/QueryStringFilterTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models\Filters; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models\Filters; use MicrosoftAzure\Storage\Table\Models\Filters\QueryStringFilter; diff --git a/tests/unit/Table/Models/Filters/UnaryFilterTest.php b/tests/Unit/Table/Models/Filters/UnaryFilterTest.php similarity index 97% rename from tests/unit/Table/Models/Filters/UnaryFilterTest.php rename to tests/Unit/Table/Models/Filters/UnaryFilterTest.php index fa7f0c771..d0ae4d196 100644 --- a/tests/unit/Table/Models/Filters/UnaryFilterTest.php +++ b/tests/Unit/Table/Models/Filters/UnaryFilterTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models\Filters; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models\Filters; use MicrosoftAzure\Storage\Table\Models\Filters\UnaryFilter; diff --git a/tests/unit/Table/Models/GetEntityResultTest.php b/tests/Unit/Table/Models/GetEntityResultTest.php similarity index 97% rename from tests/unit/Table/Models/GetEntityResultTest.php rename to tests/Unit/Table/Models/GetEntityResultTest.php index 7cfe1f79f..9fd61e34c 100644 --- a/tests/unit/Table/Models/GetEntityResultTest.php +++ b/tests/Unit/Table/Models/GetEntityResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models; use MicrosoftAzure\Storage\Table\Models\GetEntityResult; use MicrosoftAzure\Storage\Table\Internal\JsonODataReaderWriter; diff --git a/tests/unit/Table/Models/GetTableResultTest.php b/tests/Unit/Table/Models/GetTableResultTest.php similarity index 97% rename from tests/unit/Table/Models/GetTableResultTest.php rename to tests/Unit/Table/Models/GetTableResultTest.php index 164e2e2c5..8c3812d06 100644 --- a/tests/unit/Table/Models/GetTableResultTest.php +++ b/tests/Unit/Table/Models/GetTableResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models; use MicrosoftAzure\Storage\Table\Models\GetTableResult; use MicrosoftAzure\Storage\Table\Internal\JsonODataReaderWriter; diff --git a/tests/unit/Table/Models/InsertEntityResultTest.php b/tests/Unit/Table/Models/InsertEntityResultTest.php similarity index 97% rename from tests/unit/Table/Models/InsertEntityResultTest.php rename to tests/Unit/Table/Models/InsertEntityResultTest.php index fa93bdbc4..1db5b4830 100644 --- a/tests/unit/Table/Models/InsertEntityResultTest.php +++ b/tests/Unit/Table/Models/InsertEntityResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models; use MicrosoftAzure\Storage\Table\Models\InsertEntityResult; use MicrosoftAzure\Storage\Common\Internal\Resources; diff --git a/tests/unit/Table/Models/PropertyTest.php b/tests/Unit/Table/Models/PropertyTest.php similarity index 97% rename from tests/unit/Table/Models/PropertyTest.php rename to tests/Unit/Table/Models/PropertyTest.php index c75bdbe5c..0c6665236 100644 --- a/tests/unit/Table/Models/PropertyTest.php +++ b/tests/Unit/Table/Models/PropertyTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models; use MicrosoftAzure\Storage\Table\Models\Property; use MicrosoftAzure\Storage\Table\Models\EdmType; diff --git a/tests/unit/Table/Models/QueryEntitiesOptionsTest.php b/tests/Unit/Table/Models/QueryEntitiesOptionsTest.php similarity index 98% rename from tests/unit/Table/Models/QueryEntitiesOptionsTest.php rename to tests/Unit/Table/Models/QueryEntitiesOptionsTest.php index 0f958f4df..aab9ce01b 100644 --- a/tests/unit/Table/Models/QueryEntitiesOptionsTest.php +++ b/tests/Unit/Table/Models/QueryEntitiesOptionsTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models; use MicrosoftAzure\Storage\Table\Models\QueryEntitiesOptions; use MicrosoftAzure\Storage\Table\Models\Query; diff --git a/tests/unit/Table/Models/QueryEntitiesResultTest.php b/tests/Unit/Table/Models/QueryEntitiesResultTest.php similarity index 97% rename from tests/unit/Table/Models/QueryEntitiesResultTest.php rename to tests/Unit/Table/Models/QueryEntitiesResultTest.php index 0b25a187d..1e6fddc99 100644 --- a/tests/unit/Table/Models/QueryEntitiesResultTest.php +++ b/tests/Unit/Table/Models/QueryEntitiesResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models; use MicrosoftAzure\Storage\Table\Models\QueryEntitiesResult; diff --git a/tests/unit/Table/Models/QueryTablesOptionsTest.php b/tests/Unit/Table/Models/QueryTablesOptionsTest.php similarity index 98% rename from tests/unit/Table/Models/QueryTablesOptionsTest.php rename to tests/Unit/Table/Models/QueryTablesOptionsTest.php index 34fad3ae5..a48932a43 100644 --- a/tests/unit/Table/Models/QueryTablesOptionsTest.php +++ b/tests/Unit/Table/Models/QueryTablesOptionsTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models; use MicrosoftAzure\Storage\Table\Models\QueryTablesOptions; use MicrosoftAzure\Storage\Table\Models\Query; diff --git a/tests/unit/Table/Models/QueryTablesResultTest.php b/tests/Unit/Table/Models/QueryTablesResultTest.php similarity index 97% rename from tests/unit/Table/Models/QueryTablesResultTest.php rename to tests/Unit/Table/Models/QueryTablesResultTest.php index ff164a38d..1a9daffe0 100644 --- a/tests/unit/Table/Models/QueryTablesResultTest.php +++ b/tests/Unit/Table/Models/QueryTablesResultTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models; use MicrosoftAzure\Storage\Table\Models\QueryTablesResult; diff --git a/tests/unit/Table/Models/QueryTest.php b/tests/Unit/Table/Models/QueryTest.php similarity index 98% rename from tests/unit/Table/Models/QueryTest.php rename to tests/Unit/Table/Models/QueryTest.php index 5e78831c3..bdbb159f3 100644 --- a/tests/unit/Table/Models/QueryTest.php +++ b/tests/Unit/Table/Models/QueryTest.php @@ -22,7 +22,7 @@ * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models; use MicrosoftAzure\Storage\Table\Models\Query; use MicrosoftAzure\Storage\Table\Models\Filters\Filter; diff --git a/tests/unit/Table/Models/TableACLTest.php b/tests/Unit/Table/Models/TableACLTest.php similarity index 98% rename from tests/unit/Table/Models/TableACLTest.php rename to tests/Unit/Table/Models/TableACLTest.php index 350bd490c..e2fbb99ae 100644 --- a/tests/unit/Table/Models/TableACLTest.php +++ b/tests/Unit/Table/Models/TableACLTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models; use MicrosoftAzure\Storage\Table\Models\TableACL; use MicrosoftAzure\Storage\Tests\Framework\TestResources; diff --git a/tests/unit/Table/Models/UpdateEntityResultTest.php b/tests/Unit/Table/Models/UpdateEntityResultTest.php similarity index 97% rename from tests/unit/Table/Models/UpdateEntityResultTest.php rename to tests/Unit/Table/Models/UpdateEntityResultTest.php index 22e095bd4..0add8b1c1 100644 --- a/tests/unit/Table/Models/UpdateEntityResultTest.php +++ b/tests/Unit/Table/Models/UpdateEntityResultTest.php @@ -21,7 +21,7 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -namespace MicrosoftAzure\Storage\Tests\unit\Table\Models; +namespace MicrosoftAzure\Storage\Tests\Unit\Table\Models; use MicrosoftAzure\Storage\Table\Models\UpdateEntityResult; diff --git a/tests/unit/Table/TableRestProxyTest.php b/tests/Unit/Table/TableRestProxyTest.php similarity index 100% rename from tests/unit/Table/TableRestProxyTest.php rename to tests/Unit/Table/TableRestProxyTest.php From 9408d494316dc79182fb85a61a5ac85b1e49a597 Mon Sep 17 00:00:00 2001 From: Xiaoning Liu Date: Tue, 5 Sep 2017 16:45:45 +0800 Subject: [PATCH 03/11] The List Directories and Files API now accepts a new parameter that limits the listing to a specified prefix --- ChangeLog.md | 2 + src/File/FileRestProxy.php | 11 +- .../Models/ListDirectoriesAndFilesOptions.php | 23 ++++ tests/Unit/File/FileRestProxyTest.php | 111 ++++++++++++++++++ 4 files changed, 141 insertions(+), 6 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index e6ba22ac2..f2b28fa7f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,5 @@ +* Option parameter `ListDirectoriesAndFilesOptions` of `FileRestProxy::listDirectoriesAndFiles` is now able to set a prefix which limits the listing to a specified prefix. + 2017.08 - version 0.18.0 All diff --git a/src/File/FileRestProxy.php b/src/File/FileRestProxy.php index 2b1a8ffc3..e9f5e1074 100644 --- a/src/File/FileRestProxy.php +++ b/src/File/FileRestProxy.php @@ -1052,12 +1052,11 @@ public function listDirectoriesAndFilesAsync( Resources::QP_COMP, 'list' ); - //Not available until 2016-05-31 - // $this->addOptionalQueryParam( - // $queryParams, - // Resources::QP_PREFIX, - // str_replace('\\', '/', $options->getPrefix()) - // ); + $this->addOptionalQueryParam( + $queryParams, + Resources::QP_PREFIX, + $options->getPrefix() + ); $this->addOptionalQueryParam( $queryParams, Resources::QP_MARKER, diff --git a/src/File/Models/ListDirectoriesAndFilesOptions.php b/src/File/Models/ListDirectoriesAndFilesOptions.php index a37fff718..bebdf39e6 100644 --- a/src/File/Models/ListDirectoriesAndFilesOptions.php +++ b/src/File/Models/ListDirectoriesAndFilesOptions.php @@ -42,6 +42,7 @@ class ListDirectoriesAndFilesOptions extends FileServiceOptions use MarkerContinuationTokenTrait; private $maxResults; + private $prefix; /** * Gets max results which specifies the maximum number of directories and @@ -75,4 +76,26 @@ public function setMaxResults($maxResults) Validate::canCastAsString($maxResults, 'maxResults'); $this->maxResults = $maxResults; } + + /** + * Get the prefix. + * + * @return string + */ + public function getPrefix() + { + return $this->prefix; + } + + /** + * Set a specified prefix. + * + * @param string $prefix + * + * @return void + */ + public function setPrefix($prefix) + { + $this->prefix = $prefix; + } } diff --git a/tests/Unit/File/FileRestProxyTest.php b/tests/Unit/File/FileRestProxyTest.php index 56482cf0f..b54520781 100644 --- a/tests/Unit/File/FileRestProxyTest.php +++ b/tests/Unit/File/FileRestProxyTest.php @@ -326,6 +326,117 @@ public function testListDirectoriesAndFiles() $this->assertTrue($validator($result1->getFiles(), 'testfile7')); } + /** + * @covers \MicrosoftAzure\Storage\File\FileRestProxy::deleteShare + * @covers \MicrosoftAzure\Storage\File\FileRestProxy::deleteShareAsync + * @covers \MicrosoftAzure\Storage\File\FileRestProxy::createShare + * @covers \MicrosoftAzure\Storage\File\FileRestProxy::createShareAsync + * @covers \MicrosoftAzure\Storage\File\FileRestProxy::listDirectoriesAndFiles + * @covers \MicrosoftAzure\Storage\File\FileRestProxy::listDirectoriesAndFilesAsync + * @covers \MicrosoftAzure\Storage\File\FileRestProxy::createDirectory + * @covers \MicrosoftAzure\Storage\File\FileRestProxy::createDirectoryAsync + * @covers \MicrosoftAzure\Storage\File\FileRestProxy::createFile + * @covers \MicrosoftAzure\Storage\File\FileRestProxy::createFileAsync + */ + public function testListDirectoriesAndFilesWithPrefix() + { + $share = 'listdirectoriesandfileswithprefix' . $this->createSuffix(); + $this->createShare($share); + + /* + * share + * share/dir_0 + * share/dir_1 + * share/dir_1/file_10 + * share/dir_1/file_11 + * share/dir_1/dir_10 + * share/dir_2 + * share/folder_3 + * share/file_0 + * share/file_1 + * share/doc_2 + */ + $dir0 = 'dir_0'; + $dir1 = 'dir_1'; + $file10 = "$dir1/file_10"; + $file11 = "$dir1/file_11"; + $dir10 = "$dir1/dir_10"; + $dir2 = 'dir_2'; + $folder3 = 'folder_3'; + $file0 = 'file_0'; + $file1 = 'file_1'; + $doc2 = 'doc_2'; + + $this->restProxy->createDirectory($share, $dir0); + $this->restProxy->createDirectory($share, $dir1); + $this->restProxy->createDirectory($share, $dir2); + $this->restProxy->createDirectory($share, $folder3); + $this->restProxy->createDirectory($share, $dir10); + + $this->restProxy->createFile( + $share, + $file0, + Resources::MB_IN_BYTES_4 + ); + $this->restProxy->createFile( + $share, + $file1, + Resources::MB_IN_BYTES_4 + ); + $this->restProxy->createFile( + $share, + $doc2, + Resources::MB_IN_BYTES_4 + ); + $this->restProxy->createFile( + $share, + $file10, + Resources::MB_IN_BYTES_4 + ); + $this->restProxy->createFile( + $share, + $file11, + Resources::MB_IN_BYTES_4 + ); + + $optionsDirPrefix = new ListDirectoriesAndFilesOptions; + $optionsDirPrefix->setPrefix('dir'); + + $optionsFilePrefix = new ListDirectoriesAndFilesOptions; + $optionsFilePrefix->setPrefix('file'); + + $resultRootDir = $this->restProxy->listDirectoriesAndFiles($share, '', $optionsDirPrefix); + $resultRootFile = $this->restProxy->listDirectoriesAndFiles($share, '', $optionsFilePrefix); + $resultDir = $this->restProxy->listDirectoriesAndFiles($share, $dir1, $optionsDirPrefix); + $resultFile = $this->restProxy->listDirectoriesAndFiles($share, $dir1, $optionsFilePrefix); + + $validator = function ($resources, $target) { + $result = false; + foreach ($resources as $resource) { + if ($resource->getName() == $target) { + $result = true; + break; + } + } + return $result; + }; + + $this->assertEquals(3, count($resultRootDir->getDirectories())); + $this->assertEquals(2, count($resultRootFile->getFiles())); + $this->assertEquals(1, count($resultDir->getDirectories())); + $this->assertEquals(2, count($resultFile->getFiles())); + + $this->assertTrue($validator($resultRootDir->getDirectories(), $dir0)); + $this->assertTrue($validator($resultRootDir->getDirectories(), $dir1)); + $this->assertTrue($validator($resultRootDir->getDirectories(), $dir2)); + $this->assertTrue($validator($resultDir->getDirectories(), 'dir_10')); + + $this->assertTrue($validator($resultRootFile->getFiles(), $file0)); + $this->assertTrue($validator($resultRootFile->getFiles(), $file1)); + $this->assertTrue($validator($resultFile->getFiles(), 'file_10')); + $this->assertTrue($validator($resultFile->getFiles(), 'file_11')); + } + /** * @covers \MicrosoftAzure\Storage\File\FileRestProxy::deleteShare * @covers \MicrosoftAzure\Storage\File\FileRestProxy::deleteShareAsync From c74ea5a98eb535b9a432746967f537cd70c68c3f Mon Sep 17 00:00:00 2001 From: Xiaoning Liu Date: Thu, 31 Aug 2017 17:12:21 +0800 Subject: [PATCH 04/11] The `BlobRestProxy::createMessage` now returns information about the message that was just added, including the pop receipt --- ChangeLog.md | 1 + src/Queue/Internal/IQueue.php | 2 +- src/Queue/Models/CreateMessageResult.php | 93 +++++++++++++++++++ src/Queue/Models/PeekMessagesResult.php | 6 +- src/Queue/Models/QueueMessage.php | 69 ++++++++++---- src/Queue/QueueRestProxy.php | 32 ++++--- tests/Framework/TestResources.php | 12 +++ .../Queue/Models/PeekMessagesResultTest.php | 32 +++++-- tests/Unit/Queue/QueueRestProxyTest.php | 17 +++- .../Queue/Models/CreateMessageResultTest.php | 78 ++++++++++++++++ 10 files changed, 299 insertions(+), 43 deletions(-) create mode 100644 src/Queue/Models/CreateMessageResult.php create mode 100644 tests/unit/Queue/Models/CreateMessageResultTest.php diff --git a/ChangeLog.md b/ChangeLog.md index f2b28fa7f..3f9ec12d2 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,4 +1,5 @@ * Option parameter `ListDirectoriesAndFilesOptions` of `FileRestProxy::listDirectoriesAndFiles` is now able to set a prefix which limits the listing to a specified prefix. +* The `BlobRestProxy::createMessage` now returns information about the message that was just added, including the pop receipt. 2017.08 - version 0.18.0 diff --git a/src/Queue/Internal/IQueue.php b/src/Queue/Internal/IQueue.php index 725ba70b4..157f1cc5a 100644 --- a/src/Queue/Internal/IQueue.php +++ b/src/Queue/Internal/IQueue.php @@ -257,7 +257,7 @@ public function setQueueMetadataAsync( * @param string $messageText The message contents. * @param QueueModels\CreateMessageOptions $options The optional parameters. * - * @return void + * @return QueueModels\CreateMessageResult */ public function createMessage( $queueName, diff --git a/src/Queue/Models/CreateMessageResult.php b/src/Queue/Models/CreateMessageResult.php new file mode 100644 index 000000000..faafa3a3a --- /dev/null +++ b/src/Queue/Models/CreateMessageResult.php @@ -0,0 +1,93 @@ + + * @copyright 2017 Microsoft Corporation + * @license https://github.com/azure/azure-storage-php/LICENSE + * @link https://github.com/azure/azure-storage-php + */ + +namespace MicrosoftAzure\Storage\Queue\Models; + +use MicrosoftAzure\Storage\Common\Internal\Utilities; +use MicrosoftAzure\Storage\Common\Internal\Resources; + +/** + * Holds results of CreateMessage wrapper. + * + * @category Microsoft + * @package MicrosoftAzure\Storage\Queue\Models + * @author Azure Storage PHP SDK + * @copyright 2017 Microsoft Corporation + * @license https://github.com/azure/azure-storage-php/LICENSE + * @link https://github.com/azure/azure-storage-php + */ +class CreateMessageResult +{ + private $queueMessage; + + /** + * Creates CreateMessageResult object from parsed XML response. + * + * @param array $parsedResponse XML response parsed into array. + * + * @internal + * + * @return CreateMessageResult + */ + public static function create($parsedResponse) + { + $result = new CreateMessageResult(); + + if (!empty($parsedResponse) && + !empty($parsedResponse[Resources::QP_QUEUE_MESSAGE]) + ) { + $result->setQueueMessage( + QueueMessage::createFromCreateMessage( + $parsedResponse[Resources::QP_QUEUE_MESSAGE] + ) + ); + } + + return $result; + } + + /** + * Gets queueMessage field. + * + * @return QueueMessage + */ + public function getQueueMessage() + { + return $this->queueMessage; + } + + /** + * Sets queueMessage field. + * + * @param QueueMessage $queueMessage value to use. + * + * @internal + * + * @return void + */ + protected function setQueueMessage($queueMessage) + { + $this->queueMessage = $queueMessage; + } +} diff --git a/src/Queue/Models/PeekMessagesResult.php b/src/Queue/Models/PeekMessagesResult.php index 0a089a739..b44d20719 100644 --- a/src/Queue/Models/PeekMessagesResult.php +++ b/src/Queue/Models/PeekMessagesResult.php @@ -39,7 +39,7 @@ */ class PeekMessagesResult { - private $_queueMessages; + private $queueMessages; /** * Creates PeekMessagesResult object from parsed XML response. @@ -79,7 +79,7 @@ public function getQueueMessages() { $clonedMessages = array(); - foreach ($this->_queueMessages as $value) { + foreach ($this->queueMessages as $value) { $clonedMessages[] = clone $value; } @@ -97,6 +97,6 @@ public function getQueueMessages() */ protected function setQueueMessages($queueMessages) { - $this->_queueMessages = $queueMessages; + $this->queueMessages = $queueMessages; } } diff --git a/src/Queue/Models/QueueMessage.php b/src/Queue/Models/QueueMessage.php index fbc93f082..72e429593 100644 --- a/src/Queue/Models/QueueMessage.php +++ b/src/Queue/Models/QueueMessage.php @@ -39,12 +39,12 @@ */ class QueueMessage { - private $_messageId; - private $_insertionDate; - private $_expirationDate; - private $_popReceipt; - private $_timeNextVisible; - private $_dequeueCount; + private $messageId; + private $insertionDate; + private $expirationDate; + private $popReceipt; + private $timeNextVisible; + private $dequeueCount; private $_messageText; private static $xmlRootName = 'QueueMessage'; @@ -99,6 +99,39 @@ public static function createFromPeekMessages(array $parsedResponse) return $msg; } + + /** + * Creates QueueMessage object from parsed XML response of + * createMessage. + * + * @param array $parsedResponse XML response parsed into array. + * + * @internal + * + * @return QueueMessage + */ + public static function createFromCreateMessage(array $parsedResponse) + { + $msg = new QueueMessage(); + + $expirationDate = $parsedResponse['ExpirationTime']; + $insertionDate = $parsedResponse['InsertionTime']; + $timeNextVisible = $parsedResponse['TimeNextVisible']; + + $date = Utilities::rfc1123ToDateTime($expirationDate); + $msg->setExpirationDate($date); + + $date = Utilities::rfc1123ToDateTime($insertionDate); + $msg->setInsertionDate($date); + + $date = Utilities::rfc1123ToDateTime($timeNextVisible); + $msg->setTimeNextVisible($date); + + $msg->setMessageId($parsedResponse['MessageId']); + $msg->setPopReceipt($parsedResponse['PopReceipt']); + + return $msg; + } /** * Gets message text field. @@ -129,7 +162,7 @@ public function setMessageText($messageText) */ public function getMessageId() { - return $this->_messageId; + return $this->messageId; } /** @@ -141,7 +174,7 @@ public function getMessageId() */ public function setMessageId($messageId) { - $this->_messageId = $messageId; + $this->messageId = $messageId; } /** @@ -151,7 +184,7 @@ public function setMessageId($messageId) */ public function getInsertionDate() { - return $this->_insertionDate; + return $this->insertionDate; } /** @@ -165,7 +198,7 @@ public function getInsertionDate() */ public function setInsertionDate(\DateTime $insertionDate) { - $this->_insertionDate = $insertionDate; + $this->insertionDate = $insertionDate; } /** @@ -175,7 +208,7 @@ public function setInsertionDate(\DateTime $insertionDate) */ public function getExpirationDate() { - return $this->_expirationDate; + return $this->expirationDate; } /** @@ -187,7 +220,7 @@ public function getExpirationDate() */ public function setExpirationDate(\DateTime $expirationDate) { - $this->_expirationDate = $expirationDate; + $this->expirationDate = $expirationDate; } /** @@ -197,7 +230,7 @@ public function setExpirationDate(\DateTime $expirationDate) */ public function getTimeNextVisible() { - return $this->_timeNextVisible; + return $this->timeNextVisible; } /** @@ -209,7 +242,7 @@ public function getTimeNextVisible() */ public function setTimeNextVisible($timeNextVisible) { - $this->_timeNextVisible = $timeNextVisible; + $this->timeNextVisible = $timeNextVisible; } /** @@ -219,7 +252,7 @@ public function setTimeNextVisible($timeNextVisible) */ public function getPopReceipt() { - return $this->_popReceipt; + return $this->popReceipt; } /** @@ -231,7 +264,7 @@ public function getPopReceipt() */ public function setPopReceipt($popReceipt) { - $this->_popReceipt = $popReceipt; + $this->popReceipt = $popReceipt; } /** @@ -241,7 +274,7 @@ public function setPopReceipt($popReceipt) */ public function getDequeueCount() { - return $this->_dequeueCount; + return $this->dequeueCount; } /** @@ -255,7 +288,7 @@ public function getDequeueCount() */ public function setDequeueCount($dequeueCount) { - $this->_dequeueCount = $dequeueCount; + $this->dequeueCount = $dequeueCount; } /** diff --git a/src/Queue/QueueRestProxy.php b/src/Queue/QueueRestProxy.php index 2369894c5..42996e88b 100644 --- a/src/Queue/QueueRestProxy.php +++ b/src/Queue/QueueRestProxy.php @@ -24,27 +24,28 @@ namespace MicrosoftAzure\Storage\Queue; -use MicrosoftAzure\Storage\Common\Internal\ServiceRestTrait; +use MicrosoftAzure\Storage\Common\Internal\Http\HttpFormatter; use MicrosoftAzure\Storage\Common\Internal\Resources; -use MicrosoftAzure\Storage\Common\Internal\Validate; -use MicrosoftAzure\Storage\Common\Internal\Utilities; use MicrosoftAzure\Storage\Common\Internal\ServiceRestProxy; +use MicrosoftAzure\Storage\Common\Internal\ServiceRestTrait; +use MicrosoftAzure\Storage\Common\Internal\Utilities; +use MicrosoftAzure\Storage\Common\Internal\Validate; use MicrosoftAzure\Storage\Common\LocationMode; use MicrosoftAzure\Storage\Queue\Internal\IQueue; -use MicrosoftAzure\Storage\Queue\Models\ListQueuesOptions; -use MicrosoftAzure\Storage\Queue\Models\ListQueuesResult; +use MicrosoftAzure\Storage\Queue\Models\CreateMessageOptions; +use MicrosoftAzure\Storage\Queue\Models\CreateMessageResult; use MicrosoftAzure\Storage\Queue\Models\CreateQueueOptions; -use MicrosoftAzure\Storage\Queue\Models\QueueServiceOptions; use MicrosoftAzure\Storage\Queue\Models\GetQueueMetadataResult; -use MicrosoftAzure\Storage\Queue\Models\CreateMessageOptions; -use MicrosoftAzure\Storage\Queue\Models\QueueACL; -use MicrosoftAzure\Storage\Queue\Models\QueueMessage; use MicrosoftAzure\Storage\Queue\Models\ListMessagesOptions; use MicrosoftAzure\Storage\Queue\Models\ListMessagesResult; +use MicrosoftAzure\Storage\Queue\Models\ListQueuesOptions; +use MicrosoftAzure\Storage\Queue\Models\ListQueuesResult; use MicrosoftAzure\Storage\Queue\Models\PeekMessagesOptions; use MicrosoftAzure\Storage\Queue\Models\PeekMessagesResult; +use MicrosoftAzure\Storage\Queue\Models\QueueACL; +use MicrosoftAzure\Storage\Queue\Models\QueueMessage; +use MicrosoftAzure\Storage\Queue\Models\QueueServiceOptions; use MicrosoftAzure\Storage\Queue\Models\UpdateMessageResult; -use MicrosoftAzure\Storage\Common\Internal\Http\HttpFormatter; /** * This class constructs HTTP requests and receive HTTP responses for queue @@ -203,14 +204,14 @@ public function clearMessagesAsync( * @param string $messageText The message contents. * @param CreateMessageOptions $options The optional parameters. * - * @return void + * @return CreateMessageResult */ public function createMessage( $queueName, $messageText, CreateMessageOptions $options = null ) { - $this->createMessageAsync($queueName, $messageText, $options)->wait(); + return $this->createMessageAsync($queueName, $messageText, $options)->wait(); } /** @@ -269,6 +270,8 @@ public function createMessageAsync( $options->setLocationMode(LocationMode::PRIMARY_ONLY); + $dataSerializer = $this->dataSerializer; + return $this->sendAsync( $method, $headers, @@ -278,7 +281,10 @@ public function createMessageAsync( Resources::STATUS_CREATED, $body, $options - ); + )->then(function ($response) use ($dataSerializer) { + $parsed = $dataSerializer->unserialize($response->getBody()); + return CreateMessageResult::create($parsed); + }, null); } /** diff --git a/tests/Framework/TestResources.php b/tests/Framework/TestResources.php index a820d04bc..4d4dd156e 100644 --- a/tests/Framework/TestResources.php +++ b/tests/Framework/TestResources.php @@ -836,6 +836,18 @@ public static function listMessagesSample() return $sample; } + public static function createMessageSample() + { + $sample = array(); + $sample['QueueMessage']['MessageId'] = '5974b586-0df3-4e2d-ad0c-18e3892bfca2'; + $sample['QueueMessage']['InsertionTime'] = 'Fri, 09 Oct 2009 21:04:30 GMT'; + $sample['QueueMessage']['ExpirationTime'] = 'Fri, 16 Oct 2009 21:04:30 GMT'; + $sample['QueueMessage']['PopReceipt'] = 'YzQ4Yzg1MDItYTc0Ny00OWNjLTkxYTUtZGM0MDFiZDAwYzEw'; + $sample['QueueMessage']['TimeNextVisible'] = 'Fri, 09 Oct 2009 23:29:20 GMT'; + + return $sample; + } + public static function listMessagesMultipleMessagesSample() { $sample = array(); diff --git a/tests/Unit/Queue/Models/PeekMessagesResultTest.php b/tests/Unit/Queue/Models/PeekMessagesResultTest.php index ae0dcded6..d30c1405e 100644 --- a/tests/Unit/Queue/Models/PeekMessagesResultTest.php +++ b/tests/Unit/Queue/Models/PeekMessagesResultTest.php @@ -49,19 +49,37 @@ public function testCreate() { // Setup $sample = TestResources::listMessagesSample(); - - + // Test $result = PeekMessagesResult::create($sample); // Assert $actual = $result->getQueueMessages(); $this->assertCount(1, $actual); - $this->assertEquals($sample['QueueMessage']['MessageId'], $actual[0]->getMessageId()); - $this->assertEquals(Utilities::rfc1123ToDateTime($sample['QueueMessage']['InsertionTime']), $actual[0]->getInsertionDate()); - $this->assertEquals(Utilities::rfc1123ToDateTime($sample['QueueMessage']['ExpirationTime']), $actual[0]->getExpirationDate()); - $this->assertEquals(intval($sample['QueueMessage']['DequeueCount']), $actual[0]->getDequeueCount()); - $this->assertEquals($sample['QueueMessage']['MessageText'], $actual[0]->getMessageText()); + $this->assertEquals( + $sample['QueueMessage']['MessageId'], + $actual[0]->getMessageId() + ); + $this->assertEquals( + Utilities::rfc1123ToDateTime( + $sample['QueueMessage']['InsertionTime'] + ), + $actual[0]->getInsertionDate() + ); + $this->assertEquals( + Utilities::rfc1123ToDateTime( + $sample['QueueMessage']['ExpirationTime'] + ), + $actual[0]->getExpirationDate() + ); + $this->assertEquals( + intval($sample['QueueMessage']['DequeueCount']), + $actual[0]->getDequeueCount() + ); + $this->assertEquals( + $sample['QueueMessage']['MessageText'], + $actual[0]->getMessageText() + ); } /** diff --git a/tests/Unit/Queue/QueueRestProxyTest.php b/tests/Unit/Queue/QueueRestProxyTest.php index f7812dc4c..c6678f736 100644 --- a/tests/Unit/Queue/QueueRestProxyTest.php +++ b/tests/Unit/Queue/QueueRestProxyTest.php @@ -378,13 +378,28 @@ public function testCreateMessage() $this->createQueue($name); // Test - $this->restProxy->createMessage($name, $expected); + $createResult = $this->restProxy->createMessage($name, $expected); // Assert $result = $this->restProxy->listMessages($name); $messages = $result->getQueueMessages(); $actual = $messages[0]->getMessageText(); $this->assertEquals($expected, $actual); + + $message = $createResult->getQueueMessage(); + $this->assertNotNull($message->getExpirationDate()); + $this->assertNotNull($message->getInsertionDate()); + $this->assertNotNull($message->getTimeNextVisible()); + $this->assertNotNull($message->getMessageId()); + $this->assertNotNull($message->getPopReceipt()); + + $this->assertEquals( + $message->getInsertionDate(), + $message->getTimeNextVisible() + ); + $this->assertTrue( + $message->getExpirationDate() > $message->getInsertionDate() + ); } /** diff --git a/tests/unit/Queue/Models/CreateMessageResultTest.php b/tests/unit/Queue/Models/CreateMessageResultTest.php new file mode 100644 index 000000000..91d69d820 --- /dev/null +++ b/tests/unit/Queue/Models/CreateMessageResultTest.php @@ -0,0 +1,78 @@ + + * @copyright 2017 Microsoft Corporation + * @license https://github.com/azure/azure-storage-php/LICENSE + * @link https://github.com/azure/azure-storage-php + */ + +namespace MicrosoftAzure\Storage\Tests\unit\Queue\Models; + +use MicrosoftAzure\Storage\Common\Internal\Utilities; +use MicrosoftAzure\Storage\Queue\Models\CreateMessageResult; +use MicrosoftAzure\Storage\Tests\Framework\TestResources; + +/** + * Unit tests for class CreateMessageResult + * + * @category Microsoft + * @package MicrosoftAzure\Storage\Tests\Unit\Queue\Models + * @author Azure Storage PHP SDK + * @copyright 2017 Microsoft Corporation + * @license https://github.com/azure/azure-storage-php/LICENSE + * @link https://github.com/azure/azure-storage-php + */ +class CreateMessageResultTest extends \PHPUnit_Framework_TestCase +{ + /** + * @covers MicrosoftAzure\Storage\Queue\Models\CreateMessageResult::create + * @covers MicrosoftAzure\Storage\Queue\Models\CreateMessageResult::getQueueMessage + * @covers MicrosoftAzure\Storage\Queue\Models\CreateMessageResult::setQueueMessage + */ + public function testCreate() + { + // Setup + $sample = TestResources::createMessageSample(); + + // Test + $result = CreateMessageResult::create($sample); + + // Assert + $actual = $result->getQueueMessage(); + $this->assertNotNull($actual); + $this->assertEquals($sample['QueueMessage']['MessageId'], + $actual->getMessageId() + ); + $this->assertEquals(Utilities::rfc1123ToDateTime( + $sample['QueueMessage']['InsertionTime']), + $actual->getInsertionDate() + ); + $this->assertEquals(Utilities::rfc1123ToDateTime( + $sample['QueueMessage']['ExpirationTime']), + $actual->getExpirationDate() + ); + $this->assertEquals($sample['QueueMessage']['PopReceipt'], + $actual->getPopReceipt() + ); + $this->assertEquals(Utilities::rfc1123ToDateTime( + $sample['QueueMessage']['TimeNextVisible']), + $actual->getTimeNextVisible() + ); + } +} From 9a1ed127a38a606ca92b3fd327fe10bba14078d6 Mon Sep 17 00:00:00 2001 From: Xiaoning Liu Date: Thu, 14 Sep 2017 11:04:08 +0800 Subject: [PATCH 05/11] Fixed wrong XMLSerializer in ServiceException.php GitHub issue #100 --- ChangeLog.md | 1 + src/Common/Exceptions/ServiceException.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 3f9ec12d2..e5f6a15bd 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,6 @@ * Option parameter `ListDirectoriesAndFilesOptions` of `FileRestProxy::listDirectoriesAndFiles` is now able to set a prefix which limits the listing to a specified prefix. * The `BlobRestProxy::createMessage` now returns information about the message that was just added, including the pop receipt. +* Fixed wrong `XmlSerializer` in ServiceException.php. 2017.08 - version 0.18.0 diff --git a/src/Common/Exceptions/ServiceException.php b/src/Common/Exceptions/ServiceException.php index 40d6ee7a1..40045f158 100644 --- a/src/Common/Exceptions/ServiceException.php +++ b/src/Common/Exceptions/ServiceException.php @@ -24,7 +24,7 @@ namespace MicrosoftAzure\Storage\Common\Exceptions; -use MicrosoftAzure\Storage\Common\Internal\Serialization\XMLSerializer; +use MicrosoftAzure\Storage\Common\Internal\Serialization\XmlSerializer; use MicrosoftAzure\Storage\Common\Internal\Resources; use Psr\Http\Message\ResponseInterface; @@ -83,7 +83,7 @@ protected static function parseErrorMessage(ResponseInterface $response) { //try to parse using xml serializer, if failed, return the whole body //as the error message. - $serializer = new XMLSerializer(); + $serializer = new XmlSerializer(); $errorMessage = ''; try { $internalErrors = libxml_use_internal_errors(true); From 642f0fad1e69724b2a333f46c1b5ff06cbb438b7 Mon Sep 17 00:00:00 2001 From: Xiaoning Liu Date: Thu, 7 Sep 2017 18:58:34 +0800 Subject: [PATCH 06/11] Supported Incremental Copy Page Blob. Fixed a bug that `BlobRestProxy::createPageBlobFromContent` cannot work. --- ChangeLog.md | 4 +- src/Blob/BlobRestProxy.php | 14 +- src/Blob/Models/BlobProperties.php | 80 ++++++++++- src/Blob/Models/CopyBlobOptions.php | 49 +++++-- src/Blob/Models/ListBlobsResult.php | 46 +++---- src/Common/Internal/ACLBase.php | 2 +- src/Common/Internal/Resources.php | 2 + tests/Framework/TestResources.php | 4 +- tests/Unit/Blob/BlobRestProxyTest.php | 128 ++++++++++++++++++ tests/Unit/Blob/Models/BlobPropertiesTest.php | 39 +++++- .../Unit/Blob/Models/CopyBlobOptionsTest.php | 13 ++ 11 files changed, 336 insertions(+), 45 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index e5f6a15bd..8391a644b 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,12 +1,14 @@ * Option parameter `ListDirectoriesAndFilesOptions` of `FileRestProxy::listDirectoriesAndFiles` is now able to set a prefix which limits the listing to a specified prefix. * The `BlobRestProxy::createMessage` now returns information about the message that was just added, including the pop receipt. * Fixed wrong `XmlSerializer` in ServiceException.php. +* Added support for Incremental Copy Page Blob. This allows efficient copying and backup of page blob snapshots. +* Fixed a bug that `BlobRestProxy::createPageBlobFromContent` cannot work. 2017.08 - version 0.18.0 All * Updated `SharedAccessSignatureHelper` to accept `Datetime` type as `signedExpiry` or `signedStart` parameter when generating SAS tokens. -* Added samples under samples foder to generate account level or service level SAS tokens with `SharedAccessSignatureHelper`. +* Added samples under the samples folder to generate account level or service level SAS tokens with `SharedAccessSignatureHelper`. * Fixed wrong PHPUnit `@covers` tags in unit and functional test. * Removed unused imports declarations. diff --git a/src/Blob/BlobRestProxy.php b/src/Blob/BlobRestProxy.php index dc0367e39..e927bfa94 100644 --- a/src/Blob/BlobRestProxy.php +++ b/src/Blob/BlobRestProxy.php @@ -1661,6 +1661,10 @@ public function createPageBlobFromContentAsync( $body = Psr7\stream_for($content); $self = $this; + if (is_null($options)) { + $options = new CreateBlobOptions(); + } + $createBlobPromise = $this->createPageBlobAsync( $container, $blob, @@ -2014,7 +2018,7 @@ private function uploadPageBlobAsync( return $this->sendConcurrentAsync( $generator, Resources::STATUS_CREATED, - $options->getRequestOptions() + $options ); } @@ -3757,6 +3761,14 @@ public function copyBlobAsync( if (is_null($options)) { $options = new CopyBlobOptions(); } + + if ($options->getIsIncrementalCopy()) { + $this->addOptionalQueryParam( + $queryParams, + Resources::QP_COMP, + 'incrementalcopy' + ); + } $sourceBlobPath = $this->getCopyBlobSourceName( $sourceContainer, diff --git a/src/Blob/Models/BlobProperties.php b/src/Blob/Models/BlobProperties.php index 6593652ba..b5d005f74 100644 --- a/src/Blob/Models/BlobProperties.php +++ b/src/Blob/Models/BlobProperties.php @@ -58,6 +58,8 @@ class BlobProperties private $_serverEncrypted; private $_committedBlockCount; private $_copyState; + private $copyDestinationSnapshot; + private $incrementalCopy; /** * Creates BlobProperties object from $parsed response in array representation of XML elements @@ -78,6 +80,13 @@ public static function createFromXml(array $parsed) $result->setLeaseState(Utilities::tryGetValue($clean, 'leasestate')); $result->setLeaseDuration(Utilities::tryGetValue($clean, 'leaseduration')); $result->setCopyState(CopyState::createFromXml($clean)); + + $result->setIncrementalCopy( + Utilities::toBoolean( + Utilities::tryGetValue($clean, 'incrementalcopy'), + true + ) + ); return $result; } @@ -102,13 +111,38 @@ public static function createFromHttpHeaders(array $parsed) $result->setLeaseStatus(Utilities::tryGetValue($clean, Resources::X_MS_LEASE_STATUS)); $result->setLeaseState(Utilities::tryGetValue($clean, Resources::X_MS_LEASE_STATE)); $result->setLeaseDuration(Utilities::tryGetValue($clean, Resources::X_MS_LEASE_DURATION)); + $result->setCopyState(CopyState::createFromHttpHeaders($clean)); + $result->setServerEncrypted( - Utilities::toBoolean(Utilities::trygetvalue($clean, Resources::X_MS_SERVER_ENCRYPTED), true) + Utilities::toBoolean( + Utilities::tryGetValue( + $clean, + Resources::X_MS_SERVER_ENCRYPTED + ), + true + ) + ); + $result->setIncrementalCopy( + Utilities::toBoolean( + Utilities::tryGetValue( + $clean, + Resources::X_MS_INCREMENTAL_COPY + ), + true + ) ); $result->setCommittedBlockCount( - intval(Utilities::tryGetValue($clean, Resources::X_MS_BLOB_COMMITTED_BLOCK_COUNT)) + intval(Utilities::tryGetValue( + $clean, + Resources::X_MS_BLOB_COMMITTED_BLOCK_COUNT + )) + ); + $result->setCopyDestinationSnapshot( + Utilities::tryGetValue( + $clean, + Resources::X_MS_COPY_DESTINATION_SNAPSHOT + ) ); - $result->setCopyState(CopyState::createFromHttpHeaders($clean)); return $result; } @@ -512,6 +546,46 @@ public function setCopyState($copyState) $this->_copyState = $copyState; } + /** + * Gets snapshot time of the last successful incremental copy snapshot for this blob. + * + * @return string + */ + public function getCopyDestinationSnapshot() + { + return $this->copyDestinationSnapshot; + } + + /** + * Sets snapshot time of the last successful incremental copy snapshot for this blob. + * + * @param string $copyDestinationSnapshot last successful incremental copy snapshot. + */ + public function setCopyDestinationSnapshot($copyDestinationSnapshot) + { + $this->copyDestinationSnapshot = $copyDestinationSnapshot; + } + + /** + * Gets whether the blob is an incremental copy blob. + * + * @return boolean + */ + public function getIncrementalCopy() + { + return $this->incrementalCopy; + } + + /** + * Sets whether the blob is an incremental copy blob. + * + * @param boolean $incrementalCopy whether blob is an incremental copy blob. + */ + public function setIncrementalCopy($incrementalCopy) + { + $this->incrementalCopy = $incrementalCopy; + } + private function setCommonBlobProperties(array $clean) { $date = Utilities::tryGetValue($clean, Resources::LAST_MODIFIED); diff --git a/src/Blob/Models/CopyBlobOptions.php b/src/Blob/Models/CopyBlobOptions.php index 774669e75..2db7270ad 100644 --- a/src/Blob/Models/CopyBlobOptions.php +++ b/src/Blob/Models/CopyBlobOptions.php @@ -36,10 +36,11 @@ */ class CopyBlobOptions extends BlobServiceOptions { - private $_sourceLeaseId; - private $_sourceAccessConditions; - private $_metadata; - private $_sourceSnapshot; + private $sourceLeaseId; + private $sourceAccessConditions; + private $metadata; + private $sourceSnapshot; + private $isIncrementalCopy; /** * Gets source access condition @@ -48,7 +49,7 @@ class CopyBlobOptions extends BlobServiceOptions */ public function getSourceAccessConditions() { - return $this->_sourceAccessConditions; + return $this->sourceAccessConditions; } /** @@ -62,9 +63,9 @@ public function setSourceAccessConditions($sourceAccessConditions) { if (!is_null($sourceAccessConditions) && is_array($sourceAccessConditions)) { - $this->_sourceAccessConditions = $sourceAccessConditions; + $this->sourceAccessConditions = $sourceAccessConditions; } else { - $this->_sourceAccessConditions = [$sourceAccessConditions]; + $this->sourceAccessConditions = [$sourceAccessConditions]; } } @@ -75,7 +76,7 @@ public function setSourceAccessConditions($sourceAccessConditions) */ public function getMetadata() { - return $this->_metadata; + return $this->metadata; } /** @@ -87,7 +88,7 @@ public function getMetadata() */ public function setMetadata(array $metadata) { - $this->_metadata = $metadata; + $this->metadata = $metadata; } /** @@ -97,7 +98,7 @@ public function setMetadata(array $metadata) */ public function getSourceSnapshot() { - return $this->_sourceSnapshot; + return $this->sourceSnapshot; } /** @@ -109,7 +110,7 @@ public function getSourceSnapshot() */ public function setSourceSnapshot($sourceSnapshot) { - $this->_sourceSnapshot = $sourceSnapshot; + $this->sourceSnapshot = $sourceSnapshot; } /** @@ -119,7 +120,7 @@ public function setSourceSnapshot($sourceSnapshot) */ public function getSourceLeaseId() { - return $this->_sourceLeaseId; + return $this->sourceLeaseId; } /** @@ -131,6 +132,28 @@ public function getSourceLeaseId() */ public function setSourceLeaseId($sourceLeaseId) { - $this->_sourceLeaseId = $sourceLeaseId; + $this->sourceLeaseId = $sourceLeaseId; + } + + /** + * Gets isIncrementalCopy. + * + * @return boolean + */ + public function getIsIncrementalCopy() + { + return $this->isIncrementalCopy; + } + + /** + * Sets isIncrementalCopy. + * + * @param boolean $isIncrementalCopy + * + * @return boolean + */ + public function setIsIncrementalCopy($isIncrementalCopy) + { + $this->isIncrementalCopy = $isIncrementalCopy; } } diff --git a/src/Blob/Models/ListBlobsResult.php b/src/Blob/Models/ListBlobsResult.php index cf577a917..f3c38ad9f 100644 --- a/src/Blob/Models/ListBlobsResult.php +++ b/src/Blob/Models/ListBlobsResult.php @@ -43,13 +43,13 @@ class ListBlobsResult { use MarkerContinuationTokenTrait; - private $_blobPrefixes; - private $_blobs; - private $_delimiter; - private $_prefix; - private $_marker; - private $_maxResults; - private $_containerName; + private $blobPrefixes; + private $blobs; + private $delimiter; + private $prefix; + private $marker; + private $maxResults; + private $containerName; /** * Creates ListBlobsResult object from parsed XML response. @@ -158,7 +158,7 @@ public static function create(array $parsed, $location = '') */ public function getBlobs() { - return $this->_blobs; + return $this->blobs; } /** @@ -170,9 +170,9 @@ public function getBlobs() */ protected function setBlobs(array $blobs) { - $this->_blobs = array(); + $this->blobs = array(); foreach ($blobs as $blob) { - $this->_blobs[] = clone $blob; + $this->blobs[] = clone $blob; } } @@ -183,7 +183,7 @@ protected function setBlobs(array $blobs) */ public function getBlobPrefixes() { - return $this->_blobPrefixes; + return $this->blobPrefixes; } /** @@ -195,9 +195,9 @@ public function getBlobPrefixes() */ protected function setBlobPrefixes(array $blobPrefixes) { - $this->_blobPrefixes = array(); + $this->blobPrefixes = array(); foreach ($blobPrefixes as $blob) { - $this->_blobPrefixes[] = clone $blob; + $this->blobPrefixes[] = clone $blob; } } @@ -208,7 +208,7 @@ protected function setBlobPrefixes(array $blobPrefixes) */ public function getPrefix() { - return $this->_prefix; + return $this->prefix; } /** @@ -220,7 +220,7 @@ public function getPrefix() */ protected function setPrefix($prefix) { - $this->_prefix = $prefix; + $this->prefix = $prefix; } /** @@ -230,7 +230,7 @@ protected function setPrefix($prefix) */ public function getDelimiter() { - return $this->_delimiter; + return $this->delimiter; } /** @@ -242,7 +242,7 @@ public function getDelimiter() */ protected function setDelimiter($delimiter) { - $this->_delimiter = $delimiter; + $this->delimiter = $delimiter; } /** @@ -252,7 +252,7 @@ protected function setDelimiter($delimiter) */ public function getMarker() { - return $this->_marker; + return $this->marker; } /** @@ -264,7 +264,7 @@ public function getMarker() */ protected function setMarker($marker) { - $this->_marker = $marker; + $this->marker = $marker; } /** @@ -274,7 +274,7 @@ protected function setMarker($marker) */ public function getMaxResults() { - return $this->_maxResults; + return $this->maxResults; } /** @@ -286,7 +286,7 @@ public function getMaxResults() */ protected function setMaxResults($maxResults) { - $this->_maxResults = $maxResults; + $this->maxResults = $maxResults; } /** @@ -296,7 +296,7 @@ protected function setMaxResults($maxResults) */ public function getContainerName() { - return $this->_containerName; + return $this->containerName; } /** @@ -308,6 +308,6 @@ public function getContainerName() */ protected function setContainerName($containerName) { - $this->_containerName = $containerName; + $this->containerName = $containerName; } } diff --git a/src/Common/Internal/ACLBase.php b/src/Common/Internal/ACLBase.php index 02c2d1548..e50bd6e0a 100644 --- a/src/Common/Internal/ACLBase.php +++ b/src/Common/Internal/ACLBase.php @@ -133,7 +133,7 @@ public function fromXmlArray(array $parsed = null) } /** - * Get the type of resource this ACL relate to. + * Gets the type of resource this ACL relate to. * * @internal * diff --git a/src/Common/Internal/Resources.php b/src/Common/Internal/Resources.php index 3cac239b4..bf74cacad 100644 --- a/src/Common/Internal/Resources.php +++ b/src/Common/Internal/Resources.php @@ -189,6 +189,8 @@ class Resources const X_MS_PAGE_WRITE = 'x-ms-page-write'; const X_MS_REQUEST_SERVER_ENCRYPTED = 'x-ms-request-server-encrypted'; const X_MS_SERVER_ENCRYPTED = 'x-ms-server-encrypted'; + const X_MS_INCREMENTAL_COPY = 'x-ms-incremental-copy'; + const X_MS_COPY_DESTINATION_SNAPSHOT = 'x-ms-copy-destination-snapshot'; const X_MS_SNAPSHOT = 'x-ms-snapshot'; const X_MS_SOURCE_IF_MODIFIED_SINCE = 'x-ms-source-if-modified-since'; const X_MS_SOURCE_IF_UNMODIFIED_SINCE = 'x-ms-source-if-unmodified-since'; diff --git a/tests/Framework/TestResources.php b/tests/Framework/TestResources.php index 4d4dd156e..99e770d47 100644 --- a/tests/Framework/TestResources.php +++ b/tests/Framework/TestResources.php @@ -1242,7 +1242,9 @@ public static function listBlobsOneEntry() 'x-ms-blob-type' => 'BlockBlob', 'x-ms-lease-status' => 'locked', 'x-ms-server-encrypted' => 'false', - 'x-ms-request-server-encrypted' => 'true' + 'x-ms-request-server-encrypted' => 'true', + 'x-ms-incremental-copy' => 'true', + 'x-ms-copy-destination-snapshot'=> '2017-09-07T06:57:06.0830478Z' ) ) ); diff --git a/tests/Unit/Blob/BlobRestProxyTest.php b/tests/Unit/Blob/BlobRestProxyTest.php index 8967bac76..218fc716c 100644 --- a/tests/Unit/Blob/BlobRestProxyTest.php +++ b/tests/Unit/Blob/BlobRestProxyTest.php @@ -37,6 +37,7 @@ use MicrosoftAzure\Storage\Blob\Models\ListContainersOptions; use MicrosoftAzure\Storage\Blob\Models\ListContainersResult; use MicrosoftAzure\Storage\Blob\Models\CreateContainerOptions; +use MicrosoftAzure\Storage\Blob\Models\GetBlobPropertiesOptions; use MicrosoftAzure\Storage\Blob\Models\GetContainerPropertiesResult; use MicrosoftAzure\Storage\Blob\Models\ContainerACL; use MicrosoftAzure\Storage\Blob\Models\ListBlobsResult; @@ -2019,6 +2020,133 @@ public function testCopyBlobSnapshot() $this->assertEquals($sourceBlobContent, $destinationBlobContent); } + + /** + * @covers MicrosoftAzure\Storage\Blob\BlobRestProxy::copyBlob + * @covers MicrosoftAzure\Storage\Blob\BlobRestProxy::copyBlobAsync + * @covers MicrosoftAzure\Storage\Blob\BlobRestProxy::getCopyBlobSourceName + * @covers MicrosoftAzure\Storage\Blob\BlobRestProxy::createPageBlobFromContent + * @covers MicrosoftAzure\Storage\Blob\BlobRestProxy::createPageBlobFromContentAsync + * @covers MicrosoftAzure\Storage\Blob\BlobRestProxy::createBlobSnapshot + * @covers MicrosoftAzure\Storage\Blob\BlobRestProxy::createBlobSnapshotAsync + * @covers MicrosoftAzure\Storage\Blob\BlobRestProxy::getBlob + * @covers MicrosoftAzure\Storage\Blob\BlobRestProxy::getBlobAsync + * @covers MicrosoftAzure\Storage\Blob\BlobRestProxy::listBlobs + * @covers MicrosoftAzure\Storage\Blob\BlobRestProxy::listBlobsAsync + * @covers MicrosoftAzure\Storage\Blob\BlobRestProxy::getBlobProperties + * @covers MicrosoftAzure\Storage\Blob\BlobRestProxy::getBlobPropertiesAsync + */ + public function testCopyBlobIncremental() + { + // Setup + $sourceContainerName = 'copyblobincrementalsource' . $this->createSuffix(); + $sourceBlobName = 'sourceblob'; + $sourceContentLength = 512 * 8; + $sourceBlobContent = openssl_random_pseudo_bytes($sourceContentLength); + + $destinationContainerName = 'copyblobincrementaldest' . $this->createSuffix(); + $destinationBlobName = 'destinationblob'; + + $this->createContainer($sourceContainerName); + $this->createContainer($destinationContainerName); + + $this->restProxy->createPageBlobFromContent( + $sourceContainerName, + $sourceBlobName, + $sourceContentLength, + $sourceBlobContent + ); + + $sourceSnapshotResult = $this->restProxy->createBlobSnapshot( + $sourceContainerName, + $sourceBlobName + ); + + // Test + $options = new CopyBlobOptions(); + $options->setSourceSnapshot($sourceSnapshotResult->getSnapshot()); + $options->setIsIncrementalCopy(true); + + $this->restProxy->copyBlob( + $destinationContainerName, + $destinationBlobName, + $sourceContainerName, + $sourceBlobName, + $options + ); + + // Wait 10 seconds until copying ends + sleep(10); + + // Assert + $sourceBlob = $this->restProxy->getBlob($sourceContainerName, $sourceBlobName); + + $options = new ListBlobsOptions(); + $options->setIncludeSnapshots(true); + $listDestContainerResult = $this->restProxy->listBlobs( + $destinationContainerName, + $options + ); + + // List destination blobs, including one incremental blob and one incremental blob snapshot + $this->assertEquals( + 2, + count($listDestContainerResult->getBlobs()) + ); + foreach ($listDestContainerResult->getBlobs() as $blob) { + $this->assertEquals( + true, + $blob->getProperties()->getIncrementalCopy() + ); + + if ($blob->getSnapshot()) { + $destBlobSnapshot = $blob; + } else { + $destBlob = $blob; + } + } + + // Validate properties of incremental blob and snapshots + $destBlobProperties = $this->restProxy->getBlobProperties( + $destinationContainerName, + $destinationBlobName + )->getProperties(); + + $options = new GetBlobPropertiesOptions(); + $options->setSnapshot($destBlobSnapshot->getSnapshot()); + $destBlobSnapshotProperties = $this->restProxy->getBlobProperties( + $destinationContainerName, + $destinationBlobName, + $options + )->getProperties(); + + $this->assertTrue($destBlobProperties->getIncrementalCopy()); + $this->assertEquals( + $destBlobSnapshot->getSnapshot(), + $destBlobProperties->getCopyDestinationSnapshot() + ); + + $this->assertTrue($destBlobSnapshotProperties->getIncrementalCopy()); + $this->assertEquals( + $destBlobSnapshot->getSnapshot(), + $destBlobSnapshotProperties->getCopyDestinationSnapshot() + ); + + // Validate incremental blob snapshot content + $options = new GetBlobOptions(); + $options->setSnapshot($destBlobProperties->getCopyDestinationSnapshot()); + $destinationBlobSnapshot = $this->restProxy->getBlob( + $destinationContainerName, + $destinationBlobName, + $options + ); + + $sourceBlobContent = stream_get_contents($sourceBlob->getContentStream()); + $destinationBlobContent = + stream_get_contents($destinationBlobSnapshot->getContentStream()); + + $this->assertEquals($sourceBlobContent, $destinationBlobContent); + } /** * @covers MicrosoftAzure\Storage\Blob\BlobRestProxy::createBlobSnapshot diff --git a/tests/Unit/Blob/Models/BlobPropertiesTest.php b/tests/Unit/Blob/Models/BlobPropertiesTest.php index 45ae1b5f4..53f88c61d 100644 --- a/tests/Unit/Blob/Models/BlobPropertiesTest.php +++ b/tests/Unit/Blob/Models/BlobPropertiesTest.php @@ -65,6 +65,8 @@ public function testCreate() $this->assertEquals($expected['x-ms-blob-type'], $actual->getBlobType()); $this->assertEquals($expected['x-ms-lease-status'], $actual->getLeaseStatus()); $this->assertEquals(Utilities::toBoolean($expected['x-ms-server-encrypted']), $actual->getServerEncrypted()); + $this->assertEquals(Utilities::toBoolean($expected['x-ms-incremental-copy']), $actual->getIncrementalCopy()); + $this->assertEquals($expected['x-ms-copy-destination-snapshot'], $actual->getCopyDestinationSnapshot()); } /** @@ -292,8 +294,7 @@ public function testSetSequenceNumber() // Setup $expected = 123; $properties = new BlobProperties(); - $properties->setSequenceNumber($expected); - + // Test $properties->setSequenceNumber($expected); @@ -301,6 +302,40 @@ public function testSetSequenceNumber() $this->assertEquals($expected, $properties->getSequenceNumber()); } + /** + * @covers MicrosoftAzure\Storage\Blob\Models\BlobProperties::setCopyDestinationSnapshot + * @covers MicrosoftAzure\Storage\Blob\Models\BlobProperties::getCopyDestinationSnapshot + */ + public function testSetCopyDestinationSnapshot() + { + // Setup + $expected = '2017-09-07T06:57:06.0830478Z'; + $properties = new BlobProperties(); + + // Test + $properties->setCopyDestinationSnapshot($expected); + + // Assert + $this->assertEquals($expected, $properties->getCopyDestinationSnapshot()); + } + + /** + * @covers MicrosoftAzure\Storage\Blob\Models\BlobProperties::setIncrementalCopy + * @covers MicrosoftAzure\Storage\Blob\Models\BlobProperties::getIncrementalCopy + */ + public function testSetIncrementalCopy() + { + // Setup + $expected = true; + $properties = new BlobProperties(); + + // Test + $properties->setIncrementalCopy($expected); + + // Assert + $this->assertEquals($expected, $properties->getIncrementalCopy()); + } + /** * @covers MicrosoftAzure\Storage\Blob\Models\BlobProperties::setServerEncrypted * @covers MicrosoftAzure\Storage\Blob\Models\BlobProperties::getServerEncrypted diff --git a/tests/Unit/Blob/Models/CopyBlobOptionsTest.php b/tests/Unit/Blob/Models/CopyBlobOptionsTest.php index 3106d0419..1fcb79c4f 100644 --- a/tests/Unit/Blob/Models/CopyBlobOptionsTest.php +++ b/tests/Unit/Blob/Models/CopyBlobOptionsTest.php @@ -113,4 +113,17 @@ public function testSetSourceLeaseId() $options->setSourceLeaseId($expected); $this->assertEquals($expected, $options->getSourceLeaseId()); } + + /** + * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobOptions::setIsIncrementalCopy + * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobOptions::getIsIncrementalCopy + */ + public function testSetIsIncrementalCopy() + { + $expected = true; + $options = new CopyBlobOptions(); + + $options->setIsIncrementalCopy($expected); + $this->assertEquals($expected, $options->getIsIncrementalCopy()); + } } From 8f9ebf8e020625e0c325b42185512ed5cb5b8bcc Mon Sep 17 00:00:00 2001 From: Xiaoning Liu Date: Wed, 6 Sep 2017 19:20:37 +0800 Subject: [PATCH 07/11] Populate content MD5 for range gets on Blobs & Files. Fixed a bug that setting content MD5 cannot work when creating files. --- BreakingChanges.md | 6 + ChangeLog.md | 3 + src/Blob/Models/BlobProperties.php | 153 +++++++++++------- src/Blob/Models/GetBlobOptions.php | 26 +-- src/Blob/Models/GetBlobResult.php | 18 +-- src/Common/Internal/Resources.php | 2 + src/File/FileRestProxy.php | 2 +- src/File/Models/FileProperties.php | 44 ++++- .../Blob/BlobServiceFunctionalTest.php | 13 +- .../File/FileServiceFunctionalTest.php | 12 +- 10 files changed, 182 insertions(+), 97 deletions(-) diff --git a/BreakingChanges.md b/BreakingChanges.md index ef51345ee..0ea4d053e 100644 --- a/BreakingChanges.md +++ b/BreakingChanges.md @@ -1,3 +1,9 @@ +Blob +* Populate content MD5 for range gets on Blobs. The content MD5 returned for range gets on Blobs will be the value of the whole blob’s MD5 value. + +File +* Populate content MD5 for range gets on Files. The content MD5 returned for range gets on Files will be the value of the whole file’s MD5 value. + Tracking Breaking changes in 0.17.0 All diff --git a/ChangeLog.md b/ChangeLog.md index 8391a644b..bee59f58c 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,6 +3,9 @@ * Fixed wrong `XmlSerializer` in ServiceException.php. * Added support for Incremental Copy Page Blob. This allows efficient copying and backup of page blob snapshots. * Fixed a bug that `BlobRestProxy::createPageBlobFromContent` cannot work. +* Populate content MD5 for range gets on Blobs. The content MD5 returned for range gets on Blobs will be the value of the whole blob’s MD5 value. +* Populate content MD5 for range gets on Files. The content MD5 returned for range gets on Files will be the value of the whole file’s MD5 value. +* Fixed a bug that setting content MD5 cannot work when creating files. 2017.08 - version 0.18.0 diff --git a/src/Blob/Models/BlobProperties.php b/src/Blob/Models/BlobProperties.php index b5d005f74..6c6fc37dc 100644 --- a/src/Blob/Models/BlobProperties.php +++ b/src/Blob/Models/BlobProperties.php @@ -40,27 +40,28 @@ */ class BlobProperties { - private $_lastModified; - private $_etag; - private $_contentType; - private $_contentLength; - private $_contentEncoding; - private $_contentLanguage; - private $_contentMD5; - private $_contentRange; - private $_cacheControl; - private $_contentDisposition; - private $_blobType; - private $_leaseStatus; - private $_leaseState; - private $_leaseDuration; - private $_sequenceNumber; - private $_serverEncrypted; - private $_committedBlockCount; - private $_copyState; + private $lastModified; + private $etag; + private $contentType; + private $contentLength; + private $contentEncoding; + private $contentLanguage; + private $contentMD5; + private $contentRange; + private $cacheControl; + private $contentDisposition; + private $blobType; + private $leaseStatus; + private $leaseState; + private $leaseDuration; + private $sequenceNumber; + private $serverEncrypted; + private $committedBlockCount; + private $copyState; private $copyDestinationSnapshot; private $incrementalCopy; - + private $rangeContentMD5; + /** * Creates BlobProperties object from $parsed response in array representation of XML elements * @@ -154,7 +155,7 @@ public static function createFromHttpHeaders(array $parsed) */ public function getLastModified() { - return $this->_lastModified; + return $this->lastModified; } /** @@ -167,7 +168,7 @@ public function getLastModified() public function setLastModified(\DateTime $lastModified) { Validate::isDate($lastModified); - $this->_lastModified = $lastModified; + $this->lastModified = $lastModified; } /** @@ -177,7 +178,7 @@ public function setLastModified(\DateTime $lastModified) */ public function getETag() { - return $this->_etag; + return $this->etag; } /** @@ -189,7 +190,7 @@ public function getETag() */ public function setETag($etag) { - $this->_etag = $etag; + $this->etag = $etag; } /** @@ -199,7 +200,7 @@ public function setETag($etag) */ public function getContentType() { - return $this->_contentType; + return $this->contentType; } /** @@ -211,7 +212,7 @@ public function getContentType() */ public function setContentType($contentType) { - $this->_contentType = $contentType; + $this->contentType = $contentType; } /** @@ -221,7 +222,7 @@ public function setContentType($contentType) */ public function getContentRange() { - return $this->_contentRange; + return $this->contentRange; } /** @@ -233,7 +234,7 @@ public function getContentRange() */ public function setContentRange($contentRange) { - $this->_contentRange = $contentRange; + $this->contentRange = $contentRange; } /** @@ -243,7 +244,7 @@ public function setContentRange($contentRange) */ public function getContentLength() { - return $this->_contentLength; + return $this->contentLength; } /** @@ -256,7 +257,7 @@ public function getContentLength() public function setContentLength($contentLength) { Validate::isInteger($contentLength, 'contentLength'); - $this->_contentLength = $contentLength; + $this->contentLength = $contentLength; } /** @@ -266,7 +267,7 @@ public function setContentLength($contentLength) */ public function getContentEncoding() { - return $this->_contentEncoding; + return $this->contentEncoding; } /** @@ -278,7 +279,7 @@ public function getContentEncoding() */ public function setContentEncoding($contentEncoding) { - $this->_contentEncoding = $contentEncoding; + $this->contentEncoding = $contentEncoding; } /** @@ -288,7 +289,7 @@ public function setContentEncoding($contentEncoding) */ public function getContentLanguage() { - return $this->_contentLanguage; + return $this->contentLanguage; } /** @@ -300,7 +301,7 @@ public function getContentLanguage() */ public function setContentLanguage($contentLanguage) { - $this->_contentLanguage = $contentLanguage; + $this->contentLanguage = $contentLanguage; } /** @@ -310,7 +311,7 @@ public function setContentLanguage($contentLanguage) */ public function getContentMD5() { - return $this->_contentMD5; + return $this->contentMD5; } /** @@ -322,9 +323,31 @@ public function getContentMD5() */ public function setContentMD5($contentMD5) { - $this->_contentMD5 = $contentMD5; + $this->contentMD5 = $contentMD5; } - + + /** + * Gets blob range contentMD5. + * + * @return string + */ + public function getRangeContentMD5() + { + return $this->rangeContentMD5; + } + + /** + * Sets blob range contentMD5. + * + * @param string rangeContentMD5 value. + * + * @return void + */ + public function setRangeContentMD5($rangeContentMD5) + { + $this->rangeContentMD5 = $rangeContentMD5; + } + /** * Gets blob cacheControl. * @@ -332,7 +355,7 @@ public function setContentMD5($contentMD5) */ public function getCacheControl() { - return $this->_cacheControl; + return $this->cacheControl; } /** @@ -344,7 +367,7 @@ public function getCacheControl() */ public function setCacheControl($cacheControl) { - $this->_cacheControl = $cacheControl; + $this->cacheControl = $cacheControl; } /** @@ -354,7 +377,7 @@ public function setCacheControl($cacheControl) */ public function getContentDisposition() { - return $this->_contentDisposition; + return $this->contentDisposition; } /** @@ -366,7 +389,7 @@ public function getContentDisposition() */ public function setContentDisposition($contentDisposition) { - $this->_contentDisposition = $contentDisposition; + $this->contentDisposition = $contentDisposition; } /** @@ -376,7 +399,7 @@ public function setContentDisposition($contentDisposition) */ public function getBlobType() { - return $this->_blobType; + return $this->blobType; } /** @@ -388,7 +411,7 @@ public function getBlobType() */ public function setBlobType($blobType) { - $this->_blobType = $blobType; + $this->blobType = $blobType; } /** @@ -398,7 +421,7 @@ public function setBlobType($blobType) */ public function getLeaseStatus() { - return $this->_leaseStatus; + return $this->leaseStatus; } /** @@ -410,7 +433,7 @@ public function getLeaseStatus() */ public function setLeaseStatus($leaseStatus) { - $this->_leaseStatus = $leaseStatus; + $this->leaseStatus = $leaseStatus; } /** @@ -420,7 +443,7 @@ public function setLeaseStatus($leaseStatus) */ public function getLeaseState() { - return $this->_leaseState; + return $this->leaseState; } /** @@ -432,7 +455,7 @@ public function getLeaseState() */ public function setLeaseState($leaseState) { - $this->_leaseState = $leaseState; + $this->leaseState = $leaseState; } /** @@ -442,7 +465,7 @@ public function setLeaseState($leaseState) */ public function getLeaseDuration() { - return $this->_leaseDuration; + return $this->leaseDuration; } /** @@ -454,7 +477,7 @@ public function getLeaseDuration() */ public function setLeaseDuration($leaseDuration) { - $this->_leaseDuration = $leaseDuration; + $this->leaseDuration = $leaseDuration; } /** @@ -464,7 +487,7 @@ public function setLeaseDuration($leaseDuration) */ public function getSequenceNumber() { - return $this->_sequenceNumber; + return $this->sequenceNumber; } /** @@ -477,7 +500,7 @@ public function getSequenceNumber() public function setSequenceNumber($sequenceNumber) { Validate::isInteger($sequenceNumber, 'sequenceNumber'); - $this->_sequenceNumber = $sequenceNumber; + $this->sequenceNumber = $sequenceNumber; } /** @@ -487,7 +510,7 @@ public function setSequenceNumber($sequenceNumber) */ public function getServerEncrypted() { - return $this->_serverEncrypted; + return $this->serverEncrypted; } /** @@ -499,7 +522,7 @@ public function getServerEncrypted() */ public function setServerEncrypted($serverEncrypted) { - $this->_serverEncrypted = $serverEncrypted; + $this->serverEncrypted = $serverEncrypted; } /** @@ -509,7 +532,7 @@ public function setServerEncrypted($serverEncrypted) */ public function getCommittedBlockCount() { - return $this->_committedBlockCount; + return $this->committedBlockCount; } /** @@ -521,7 +544,7 @@ public function getCommittedBlockCount() */ public function setCommittedBlockCount($committedBlockCount) { - $this->_committedBlockCount = $committedBlockCount; + $this->committedBlockCount = $committedBlockCount; } /** @@ -531,7 +554,7 @@ public function setCommittedBlockCount($committedBlockCount) */ public function getCopyState() { - return $this->_copyState; + return $this->copyState; } /** @@ -543,7 +566,7 @@ public function getCopyState() */ public function setCopyState($copyState) { - $this->_copyState = $copyState; + $this->copyState = $copyState; } /** @@ -618,11 +641,23 @@ private function setCommonBlobProperties(array $clean) $this->setContentLanguage( Utilities::tryGetValue($clean, Resources::CONTENT_LANGUAGE) ); - $this->setContentMD5( - Utilities::tryGetValue($clean, Resources::CONTENT_MD5) - ); $this->setContentType( Utilities::tryGetValue($clean, Resources::CONTENT_TYPE) ); + + if (Utilities::tryGetValue($clean, Resources::CONTENT_MD5) && + !Utilities::tryGetValue($clean, Resources::CONTENT_RANGE) + ) { + $this->setContentMD5( + Utilities::tryGetValue($clean, Resources::CONTENT_MD5) + ); + } else { + $this->setContentMD5( + Utilities::tryGetValue($clean, Resources::BLOB_CONTENT_MD5) + ); + $this->setRangeContentMD5( + Utilities::tryGetValue($clean, Resources::CONTENT_MD5) + ); + } } } diff --git a/src/Blob/Models/GetBlobOptions.php b/src/Blob/Models/GetBlobOptions.php index 9eea9ce2b..498df5972 100644 --- a/src/Blob/Models/GetBlobOptions.php +++ b/src/Blob/Models/GetBlobOptions.php @@ -38,10 +38,10 @@ */ class GetBlobOptions extends BlobServiceOptions { - private $_snapshot; - private $_computeRangeMD5; - private $_rangeStart; - private $_rangeEnd; + private $snapshot; + private $computeRangeMD5; + private $rangeStart; + private $rangeEnd; /** * Gets blob snapshot. @@ -50,7 +50,7 @@ class GetBlobOptions extends BlobServiceOptions */ public function getSnapshot() { - return $this->_snapshot; + return $this->snapshot; } /** @@ -62,7 +62,7 @@ public function getSnapshot() */ public function setSnapshot($snapshot) { - $this->_snapshot = $snapshot; + $this->snapshot = $snapshot; } /** @@ -72,7 +72,7 @@ public function setSnapshot($snapshot) */ public function getRangeStart() { - return $this->_rangeStart; + return $this->rangeStart; } /** @@ -85,7 +85,7 @@ public function getRangeStart() public function setRangeStart($rangeStart) { Validate::isInteger($rangeStart, 'rangeStart'); - $this->_rangeStart = $rangeStart; + $this->rangeStart = $rangeStart; } /** @@ -95,7 +95,7 @@ public function setRangeStart($rangeStart) */ public function getRangeEnd() { - return $this->_rangeEnd; + return $this->rangeEnd; } /** @@ -108,7 +108,7 @@ public function getRangeEnd() public function setRangeEnd($rangeEnd) { Validate::isInteger($rangeEnd, 'rangeEnd'); - $this->_rangeEnd = $rangeEnd; + $this->rangeEnd = $rangeEnd; } /** @@ -118,9 +118,9 @@ public function setRangeEnd($rangeEnd) */ public function getComputeRangeMD5() { - return $this->_computeRangeMD5; + return $this->computeRangeMD5; } - + /** * Sets computeRangeMD5 * @@ -131,6 +131,6 @@ public function getComputeRangeMD5() public function setComputeRangeMD5($computeRangeMD5) { Validate::isBoolean($computeRangeMD5); - $this->_computeRangeMD5 = $computeRangeMD5; + $this->computeRangeMD5 = $computeRangeMD5; } } diff --git a/src/Blob/Models/GetBlobResult.php b/src/Blob/Models/GetBlobResult.php index 0aa7877d0..b12cb6362 100644 --- a/src/Blob/Models/GetBlobResult.php +++ b/src/Blob/Models/GetBlobResult.php @@ -38,9 +38,9 @@ */ class GetBlobResult { - private $_properties; - private $_metadata; - private $_contentStream; + private $properties; + private $metadata; + private $contentStream; /** * Creates GetBlobResult from getBlob call. @@ -73,7 +73,7 @@ public static function create( */ public function getMetadata() { - return $this->_metadata; + return $this->metadata; } /** @@ -85,7 +85,7 @@ public function getMetadata() */ protected function setMetadata(array $metadata) { - $this->_metadata = $metadata; + $this->metadata = $metadata; } /** @@ -95,7 +95,7 @@ protected function setMetadata(array $metadata) */ public function getProperties() { - return $this->_properties; + return $this->properties; } /** @@ -107,7 +107,7 @@ public function getProperties() */ protected function setProperties(BlobProperties $properties) { - $this->_properties = $properties; + $this->properties = $properties; } /** @@ -117,7 +117,7 @@ protected function setProperties(BlobProperties $properties) */ public function getContentStream() { - return $this->_contentStream; + return $this->contentStream; } /** @@ -129,6 +129,6 @@ public function getContentStream() */ protected function setContentStream($contentStream) { - $this->_contentStream = $contentStream; + $this->contentStream = $contentStream; } } diff --git a/src/Common/Internal/Resources.php b/src/Common/Internal/Resources.php index bf74cacad..a58a2ea5b 100644 --- a/src/Common/Internal/Resources.php +++ b/src/Common/Internal/Resources.php @@ -242,6 +242,8 @@ class Resources const ACCEPT_CHARSET = 'accept-charset'; const USER_AGENT = 'User-Agent'; const PREFER = 'Prefer'; + const BLOB_CONTENT_MD5 = 'x-ms-blob-content-md5'; + const FILE_CONTENT_MD5 = 'x-ms-content-md5'; // Type const QUEUE_TYPE_NAME = 'IQueue'; diff --git a/src/File/FileRestProxy.php b/src/File/FileRestProxy.php index e9f5e1074..df590667a 100644 --- a/src/File/FileRestProxy.php +++ b/src/File/FileRestProxy.php @@ -1566,7 +1566,7 @@ public function createFileAsync( $this->addOptionalHeader( $headers, - Resources::CONTENT_MD5, + Resources::FILE_CONTENT_MD5, $options->getContentMD5() ); diff --git a/src/File/Models/FileProperties.php b/src/File/Models/FileProperties.php index b28b9eef2..9e5b3600d 100644 --- a/src/File/Models/FileProperties.php +++ b/src/File/Models/FileProperties.php @@ -25,8 +25,8 @@ namespace MicrosoftAzure\Storage\File\Models; use MicrosoftAzure\Storage\Common\Internal\Resources; -use MicrosoftAzure\Storage\Common\Internal\Validate; use MicrosoftAzure\Storage\Common\Internal\Utilities; +use MicrosoftAzure\Storage\Common\Internal\Validate; /** * Represents file properties @@ -56,6 +56,7 @@ class FileProperties private $copyProgress; private $copySource; private $copyStatus; + private $rangeContentMD5; /** * Creates FileProperties object from $parsed response in array @@ -90,9 +91,20 @@ public static function createFromHttpHeaders(array $parsed) Utilities::tryGetValue($parsed, Resources::ETAG) ); - $result->setContentMD5( - Utilities::tryGetValue($parsed, Resources::CONTENT_MD5) - ); + if (Utilities::tryGetValue($parsed, Resources::CONTENT_MD5) && + !Utilities::tryGetValue($parsed, Resources::CONTENT_RANGE) + ) { + $result->setContentMD5( + Utilities::tryGetValue($parsed, Resources::CONTENT_MD5) + ); + } else { + $result->setContentMD5( + Utilities::tryGetValue($parsed, Resources::FILE_CONTENT_MD5) + ); + $result->setRangeContentMD5( + Utilities::tryGetValue($parsed, Resources::CONTENT_MD5) + ); + } $result->setContentEncoding( Utilities::tryGetValue($parsed, Resources::CONTENT_ENCODING) @@ -317,7 +329,29 @@ public function setContentMD5($contentMD5) { $this->contentMD5 = $contentMD5; } - + + /** + * Gets file range contentMD5. + * + * @return string + */ + public function getRangeContentMD5() + { + return $this->rangeContentMD5; + } + + /** + * Sets file range contentMD5. + * + * @param string rangeContentMD5 value. + * + * @return void + */ + public function setRangeContentMD5($rangeContentMD5) + { + $this->rangeContentMD5 = $rangeContentMD5; + } + /** * Gets file cacheControl. * diff --git a/tests/Functional/Blob/BlobServiceFunctionalTest.php b/tests/Functional/Blob/BlobServiceFunctionalTest.php index 960142638..b768e9a33 100644 --- a/tests/Functional/Blob/BlobServiceFunctionalTest.php +++ b/tests/Functional/Blob/BlobServiceFunctionalTest.php @@ -2146,7 +2146,11 @@ private function getBlobWorker($options, $container) // Make sure there is something to test $dataSize = 512; - $this->restProxy->createPageBlob($container, $blob, $dataSize); + $createBlobOptions = new CreateBlobOptions(); + if ($options && $options->getComputeRangeMD5()) { + $createBlobOptions->setContentMD5('MDAwMDAwMDA='); + } + $this->restProxy->createPageBlob($container, $blob, $dataSize, $createBlobOptions); $metadata = BlobServiceFunctionalTestData::getNiceMetadata(); $sbmd = $this->restProxy->setBlobMetadata($container, $blob, $metadata); @@ -2254,8 +2258,7 @@ private function verifyGetBlobWorker($res, $options, $dataSize, $metadata) $this->assertEquals($rangeSize, strlen($content), '$content length and range'); if ($options->getComputeRangeMD5()) { - // Compute the MD5 from the stream. - $md5 = base64_encode(md5($content, true)); + $md5 = 'MDAwMDAwMDA='; $this->assertEquals( $md5, $res->getProperties()->getContentMD5(), @@ -3337,10 +3340,10 @@ private function putListClearPageRangesWorker( $getOptions->setComputeRangeMD5(true); $result = $this->restProxy->getBlob($container, $blob, $getOptions); $actualContent = stream_get_contents($result->getContentStream()); - $actualMD5 = $result->getProperties()->getContentMD5(); + $actualMD5 = $result->getProperties()->getRangeContentMD5(); //Validate - $this->assertEquals(Utilities::calculateContentMD5($content), $actualMD5); $this->assertEquals($content, $actualContent); + $this->assertEquals(Utilities::calculateContentMD5($content), $actualMD5); } if ($clearRange != null) { $this->restProxy->clearBlobPages($container, $blob, $clearRange); diff --git a/tests/Functional/File/FileServiceFunctionalTest.php b/tests/Functional/File/FileServiceFunctionalTest.php index 3efb5ac00..495376dfc 100644 --- a/tests/Functional/File/FileServiceFunctionalTest.php +++ b/tests/Functional/File/FileServiceFunctionalTest.php @@ -1553,7 +1553,11 @@ private function getFileWorker($options, $share) // Make sure there is something to test $dataSize = 512; $content = FileServiceFunctionalTestData::getRandomBytes($dataSize); - $this->restProxy->createFileFromContent($share, $file, $content); + $createFileOptions = new CreateFileOptions(); + if ($options && $options->getRangeGetContentMD5()) { + $createFileOptions->setContentMD5('MDAwMDAwMDA='); + } + $this->restProxy->createFileFromContent($share, $file, $content, $createFileOptions); $metadata = FileServiceFunctionalTestData::getNiceMetadata(); $sbmd = $this->restProxy->setFileMetadata($share, $file, $metadata); @@ -1618,10 +1622,8 @@ private function verifyGetFileWorker($res, $options, $dataSize, $metadata) ); if ($options->getRangeGetContentMD5()) { - // Compute the MD5 from the stream. - $md5 = Utilities::calculateContentMD5($content); $this->assertEquals( - $md5, + 'MDAwMDAwMDA=', $res->getProperties()->getContentMD5(), 'asked for MD5, result->getProperties()->getContentMD5' ); @@ -1973,7 +1975,7 @@ private function putListClearRangesWorker( $getOptions->setRangeGetContentMD5(true); $result = $this->restProxy->getFile($share, $file, $getOptions); $actualContent = stream_get_contents($result->getContentStream()); - $actualMD5 = $result->getProperties()->getContentMD5(); + $actualMD5 = $result->getProperties()->getRangeContentMD5(); //Validate $this->assertEquals(Utilities::calculateContentMD5($content), $actualMD5); $this->assertEquals($content, $actualContent); From 4be66ed7dabe14c35e7d081fff96a46f8c9e3c8b Mon Sep 17 00:00:00 2001 From: Xiaoning Liu Date: Thu, 31 Aug 2017 11:30:47 +0800 Subject: [PATCH 08/11] The public access level of a container is now returned from the List Containers and Get Container Properties APIs --- ChangeLog.md | 1 + src/Blob/Models/ContainerACL.php | 4 +- src/Blob/Models/ContainerProperties.php | 62 ++++++++++++++----- src/Blob/Models/GetContainerACLResult.php | 18 +++--- .../Models/GetContainerPropertiesResult.php | 54 ++++++++++++---- src/Blob/Models/ListContainersResult.php | 35 ++++++----- src/Blob/Models/PublicAccessType.php | 6 +- tests/Unit/Blob/BlobRestProxyTest.php | 50 +++++++++++---- 8 files changed, 163 insertions(+), 67 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index bee59f58c..ae3ac0a62 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -6,6 +6,7 @@ * Populate content MD5 for range gets on Blobs. The content MD5 returned for range gets on Blobs will be the value of the whole blob’s MD5 value. * Populate content MD5 for range gets on Files. The content MD5 returned for range gets on Files will be the value of the whole file’s MD5 value. * Fixed a bug that setting content MD5 cannot work when creating files. +* The public access level of a container is now returned from the List Containers and Get Container Properties APIs. 2017.08 - version 0.18.0 diff --git a/src/Blob/Models/ContainerACL.php b/src/Blob/Models/ContainerACL.php index b07a4b884..ffb06a095 100644 --- a/src/Blob/Models/ContainerACL.php +++ b/src/Blob/Models/ContainerACL.php @@ -24,9 +24,9 @@ namespace MicrosoftAzure\Storage\Blob\Models; -use MicrosoftAzure\Storage\Common\Internal\Validate; -use MicrosoftAzure\Storage\Common\Internal\Resources; use MicrosoftAzure\Storage\Common\Internal\ACLBase; +use MicrosoftAzure\Storage\Common\Internal\Resources; +use MicrosoftAzure\Storage\Common\Internal\Validate; /** * Holds container ACL members. diff --git a/src/Blob/Models/ContainerProperties.php b/src/Blob/Models/ContainerProperties.php index 27d7045fa..33116fcf1 100644 --- a/src/Blob/Models/ContainerProperties.php +++ b/src/Blob/Models/ContainerProperties.php @@ -24,6 +24,9 @@ namespace MicrosoftAzure\Storage\Blob\Models; +use MicrosoftAzure\Storage\Common\Internal\Resources; +use MicrosoftAzure\Storage\Common\Internal\Validate; + /** * Holds container properties fields * @@ -36,12 +39,13 @@ */ class ContainerProperties { - private $_lastModified; - private $_etag; - private $_leaseStatus; - private $_leaseState; - private $_leaseDuration; - + private $etag; + private $lastModified; + private $leaseDuration; + private $leaseStatus; + private $leaseState; + private $publicAccess; + /** * Gets container lastModified. * @@ -49,7 +53,7 @@ class ContainerProperties */ public function getLastModified() { - return $this->_lastModified; + return $this->lastModified; } /** @@ -61,7 +65,7 @@ public function getLastModified() */ public function setLastModified(\DateTime $lastModified) { - $this->_lastModified = $lastModified; + $this->lastModified = $lastModified; } /** @@ -71,7 +75,7 @@ public function setLastModified(\DateTime $lastModified) */ public function getETag() { - return $this->_etag; + return $this->etag; } /** @@ -83,7 +87,7 @@ public function getETag() */ public function setETag($etag) { - $this->_etag = $etag; + $this->etag = $etag; } /** @@ -93,7 +97,7 @@ public function setETag($etag) */ public function getLeaseStatus() { - return $this->_leaseStatus; + return $this->leaseStatus; } /** @@ -105,7 +109,7 @@ public function getLeaseStatus() */ public function setLeaseStatus($leaseStatus) { - $this->_leaseStatus = $leaseStatus; + $this->leaseStatus = $leaseStatus; } /** @@ -115,7 +119,7 @@ public function setLeaseStatus($leaseStatus) */ public function getLeaseState() { - return $this->_leaseState; + return $this->leaseState; } /** @@ -127,7 +131,7 @@ public function getLeaseState() */ public function setLeaseState($leaseState) { - $this->_leaseState = $leaseState; + $this->leaseState = $leaseState; } /** @@ -137,7 +141,7 @@ public function setLeaseState($leaseState) */ public function getLeaseDuration() { - return $this->_leaseDuration; + return $this->leaseDuration; } /** @@ -149,6 +153,32 @@ public function getLeaseDuration() */ public function setLeaseDuration($leaseDuration) { - $this->_leaseDuration = $leaseDuration; + $this->leaseDuration = $leaseDuration; + } + + /** + * Gets container publicAccess. + * + * @return string + */ + public function getPublicAccess() + { + return $this->publicAccess; + } + + /** + * Sets container publicAccess. + * + * @param string $publicAccess value. + * + * @return void + */ + public function setPublicAccess($publicAccess) + { + Validate::isTrue( + PublicAccessType::isValid($publicAccess), + Resources::INVALID_BLOB_PAT_MSG + ); + $this->publicAccess = $publicAccess; } } diff --git a/src/Blob/Models/GetContainerACLResult.php b/src/Blob/Models/GetContainerACLResult.php index 250b0d8fc..1876b6d4d 100644 --- a/src/Blob/Models/GetContainerACLResult.php +++ b/src/Blob/Models/GetContainerACLResult.php @@ -36,10 +36,10 @@ */ class GetContainerACLResult { - private $_containerACL; - private $_lastModified; + private $containerACL; + private $lastModified; - private $_etag; + private $etag; /** * Parses the given array into signed identifiers @@ -76,7 +76,7 @@ public static function create( */ public function getContainerAcl() { - return $this->_containerACL; + return $this->containerACL; } /** @@ -88,7 +88,7 @@ public function getContainerAcl() */ protected function setContainerAcl(ContainerACL $containerACL) { - $this->_containerACL = $containerACL; + $this->containerACL = $containerACL; } /** @@ -98,7 +98,7 @@ protected function setContainerAcl(ContainerACL $containerACL) */ public function getLastModified() { - return $this->_lastModified; + return $this->lastModified; } /** @@ -110,7 +110,7 @@ public function getLastModified() */ protected function setLastModified(\DateTime $lastModified) { - $this->_lastModified = $lastModified; + $this->lastModified = $lastModified; } /** @@ -120,7 +120,7 @@ protected function setLastModified(\DateTime $lastModified) */ public function getETag() { - return $this->_etag; + return $this->etag; } /** @@ -132,6 +132,6 @@ public function getETag() */ protected function setETag($etag) { - $this->_etag = $etag; + $this->etag = $etag; } } diff --git a/src/Blob/Models/GetContainerPropertiesResult.php b/src/Blob/Models/GetContainerPropertiesResult.php index 252e5920c..1a87a8cd2 100644 --- a/src/Blob/Models/GetContainerPropertiesResult.php +++ b/src/Blob/Models/GetContainerPropertiesResult.php @@ -25,8 +25,9 @@ namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\MetadataTrait; -use MicrosoftAzure\Storage\Common\Internal\Utilities; use MicrosoftAzure\Storage\Common\Internal\Resources; +use MicrosoftAzure\Storage\Common\Internal\Utilities; +use MicrosoftAzure\Storage\Common\Internal\Validate; /** * Holds result of getContainerProperties and getContainerMetadata @@ -42,9 +43,10 @@ class GetContainerPropertiesResult { use MetadataTrait; - private $_leaseStatus; - private $_leaseState; - private $_leaseDuration; + private $leaseStatus; + private $leaseState; + private $leaseDuration; + private $publicAccess; /** * Gets blob leaseStatus. @@ -53,7 +55,7 @@ class GetContainerPropertiesResult */ public function getLeaseStatus() { - return $this->_leaseStatus; + return $this->leaseStatus; } /** @@ -65,7 +67,7 @@ public function getLeaseStatus() */ public function setLeaseStatus($leaseStatus) { - $this->_leaseStatus = $leaseStatus; + $this->leaseStatus = $leaseStatus; } /** @@ -75,7 +77,7 @@ public function setLeaseStatus($leaseStatus) */ public function getLeaseState() { - return $this->_leaseState; + return $this->leaseState; } /** @@ -87,7 +89,7 @@ public function getLeaseState() */ public function setLeaseState($leaseState) { - $this->_leaseState = $leaseState; + $this->leaseState = $leaseState; } /** @@ -97,7 +99,7 @@ public function setLeaseState($leaseState) */ public function getLeaseDuration() { - return $this->_leaseDuration; + return $this->leaseDuration; } /** @@ -109,7 +111,33 @@ public function getLeaseDuration() */ public function setLeaseDuration($leaseDuration) { - $this->_leaseDuration = $leaseDuration; + $this->leaseDuration = $leaseDuration; + } + + /** + * Gets container publicAccess. + * + * @return string + */ + public function getPublicAccess() + { + return $this->publicAccess; + } + + /** + * Sets container publicAccess. + * + * @param string $publicAccess value. + * + * @return void + */ + public function setPublicAccess($publicAccess) + { + Validate::isTrue( + PublicAccessType::isValid($publicAccess), + Resources::INVALID_BLOB_PAT_MSG + ); + $this->publicAccess = $publicAccess; } /** @@ -137,7 +165,11 @@ public static function create(array $responseHeaders) Resources::X_MS_LEASE_DURATION, $responseHeaders )); - + $result->setPublicAccess(Utilities::tryGetValueInsensitive( + Resources::X_MS_BLOB_PUBLIC_ACCESS, + $responseHeaders + )); + return $result; } } diff --git a/src/Blob/Models/ListContainersResult.php b/src/Blob/Models/ListContainersResult.php index e6ef14b7f..d01ba426d 100644 --- a/src/Blob/Models/ListContainersResult.php +++ b/src/Blob/Models/ListContainersResult.php @@ -43,11 +43,11 @@ class ListContainersResult { use MarkerContinuationTokenTrait; - private $_containers; - private $_prefix; - private $_marker; - private $_maxResults; - private $_accountName; + private $containers; + private $prefix; + private $marker; + private $maxResults; + private $accountName; /** * Creates ListBlobResult object from parsed XML response. @@ -126,6 +126,9 @@ public static function create(array $parsedResponse, $location = '') if (array_key_exists('LeaseDuration', $value['Properties'])) { $properties->setLeaseStatus($value['Properties']['LeaseDuration']); } + if (array_key_exists('PublicAccess', $value['Properties'])) { + $properties->setPublicAccess($value['Properties']['PublicAccess']); + } $container->setProperties($properties); $containers[] = $container; } @@ -142,9 +145,9 @@ public static function create(array $parsedResponse, $location = '') */ protected function setContainers(array $containers) { - $this->_containers = array(); + $this->containers = array(); foreach ($containers as $container) { - $this->_containers[] = clone $container; + $this->containers[] = clone $container; } } @@ -155,7 +158,7 @@ protected function setContainers(array $containers) */ public function getContainers() { - return $this->_containers; + return $this->containers; } /** @@ -165,7 +168,7 @@ public function getContainers() */ public function getPrefix() { - return $this->_prefix; + return $this->prefix; } /** @@ -177,7 +180,7 @@ public function getPrefix() */ protected function setPrefix($prefix) { - $this->_prefix = $prefix; + $this->prefix = $prefix; } /** @@ -187,7 +190,7 @@ protected function setPrefix($prefix) */ public function getMarker() { - return $this->_marker; + return $this->marker; } /** @@ -199,7 +202,7 @@ public function getMarker() */ protected function setMarker($marker) { - $this->_marker = $marker; + $this->marker = $marker; } /** @@ -209,7 +212,7 @@ protected function setMarker($marker) */ public function getMaxResults() { - return $this->_maxResults; + return $this->maxResults; } /** @@ -221,7 +224,7 @@ public function getMaxResults() */ protected function setMaxResults($maxResults) { - $this->_maxResults = $maxResults; + $this->maxResults = $maxResults; } /** @@ -231,7 +234,7 @@ protected function setMaxResults($maxResults) */ public function getAccountName() { - return $this->_accountName; + return $this->accountName; } /** @@ -243,6 +246,6 @@ public function getAccountName() */ protected function setAccountName($accountName) { - $this->_accountName = $accountName; + $this->accountName = $accountName; } } diff --git a/src/Blob/Models/PublicAccessType.php b/src/Blob/Models/PublicAccessType.php index efebf3b09..5b8c32b6b 100644 --- a/src/Blob/Models/PublicAccessType.php +++ b/src/Blob/Models/PublicAccessType.php @@ -27,7 +27,7 @@ use MicrosoftAzure\Storage\Common\Internal\Resources; /** - * Holds public acces types for a container. + * Holds public access types for a container. * * @category Microsoft * @package MicrosoftAzure\Storage\Blob\Models @@ -38,7 +38,7 @@ */ class PublicAccessType { - const NONE = Resources::EMPTY_STRING; + const NONE = null; const BLOBS_ONLY = 'blob'; const CONTAINER_AND_BLOBS = 'container'; @@ -53,6 +53,8 @@ class PublicAccessType */ public static function isValid($type) { + // When $type is null, switch statement will take it + // equal to self::NONE (EMPTY_STRING) switch ($type) { case self::NONE: case self::BLOBS_ONLY: diff --git a/tests/Unit/Blob/BlobRestProxyTest.php b/tests/Unit/Blob/BlobRestProxyTest.php index 218fc716c..3672827f1 100644 --- a/tests/Unit/Blob/BlobRestProxyTest.php +++ b/tests/Unit/Blob/BlobRestProxyTest.php @@ -40,6 +40,7 @@ use MicrosoftAzure\Storage\Blob\Models\GetBlobPropertiesOptions; use MicrosoftAzure\Storage\Blob\Models\GetContainerPropertiesResult; use MicrosoftAzure\Storage\Blob\Models\ContainerACL; +use MicrosoftAzure\Storage\Blob\Models\PublicAccessType; use MicrosoftAzure\Storage\Blob\Models\ListBlobsResult; use MicrosoftAzure\Storage\Blob\Models\ListBlobsOptions; use MicrosoftAzure\Storage\Blob\Models\ListBlobBlocksOptions; @@ -141,6 +142,7 @@ public function testListContainersWithOptions() { // Setup $prefix = $this->createPrefix(); + $container0 = $prefix . 'listcontainerwithoptions0' . $this->createSuffix(); $container1 = $prefix . 'listcontainerwithoptions1' . $this->createSuffix(); $container2 = $prefix . 'listcontainerwithoptions2' . $this->createSuffix(); $container3 = 'm' . $prefix . 'mlistcontainerwithoptions3' . $this->createSuffix(); @@ -148,7 +150,9 @@ public function testListContainersWithOptions() $metadataValue = 'MetadataValue'; $options = new CreateContainerOptions(); $options->addMetadata($metadataName, $metadataValue); - parent::createContainer($container1); + $options->setPublicAccess(PublicAccessType::BLOBS_ONLY); + parent::createContainer($container0); + parent::createContainer($container1, new CreateContainerOptions()); parent::createContainer($container2, $options); parent::createContainer($container3); $options = new ListContainersOptions(); @@ -160,11 +164,22 @@ public function testListContainersWithOptions() // Assert $containers = $result->getContainers(); - $metadata = $containers[1]->getMetadata(); - $this->assertEquals(2, count($containers)); + $metadata = $containers[2]->getMetadata(); + $this->assertEquals(3, count($containers)); + $this->assertTrue($this->existInContainerArray($container0, $containers)); $this->assertTrue($this->existInContainerArray($container1, $containers)); $this->assertTrue($this->existInContainerArray($container2, $containers)); $this->assertEquals($metadataValue, $metadata[$metadataName]); + + $this->assertEquals(PublicAccessType::CONTAINER_AND_BLOBS, + $containers[0]->getProperties()->getPublicAccess() + ); + $this->assertEquals(PublicAccessType::NONE, + $containers[1]->getProperties()->getPublicAccess() + ); + $this->assertEquals(PublicAccessType::BLOBS_ONLY, + $containers[2]->getProperties()->getPublicAccess() + ); } /** @@ -406,16 +421,29 @@ public function testDeleteContainerFail() public function testGetContainerProperties() { // Setup - $name = 'getcontainerproperties' . $this->createSuffix(); - $this->createContainer($name); - + $containerWithContainerLevelAccess = 'getcontainerproperties' . $this->createSuffix(); + $containerWithBlobLevelAccess = 'getcontainerproperties' . $this->createSuffix(); + $containerWithoutPublicAccess = 'getcontainerproperties' . $this->createSuffix(); + + $options = new CreateContainerOptions(); + $options->setPublicAccess(PublicAccessType::BLOBS_ONLY); + + $this->createContainer($containerWithContainerLevelAccess); + $this->createContainer($containerWithBlobLevelAccess, $options); + $this->createContainer($containerWithoutPublicAccess, new CreateContainerOptions()); + // Test - $result = $this->restProxy->getContainerProperties($name); - + $resultWithContainerLevelAccess = $this->restProxy->getContainerProperties($containerWithContainerLevelAccess); + $resultWithBlobLevelAccess = $this->restProxy->getContainerProperties($containerWithBlobLevelAccess); + $resultWithoutPublicAccess = $this->restProxy->getContainerProperties($containerWithoutPublicAccess); + // Assert - $this->assertNotNull($result->getETag()); - $this->assertNotNull($result->getLastModified()); - $this->assertCount(0, $result->getMetadata()); + $this->assertEquals(PublicAccessType::CONTAINER_AND_BLOBS, $resultWithContainerLevelAccess->getPublicAccess()); + $this->assertEquals(PublicAccessType::BLOBS_ONLY, $resultWithBlobLevelAccess->getPublicAccess()); + $this->assertEquals(PublicAccessType::NONE, $resultWithoutPublicAccess->getPublicAccess()); + $this->assertNotNull($resultWithContainerLevelAccess->getETag()); + $this->assertNotNull($resultWithContainerLevelAccess->getLastModified()); + $this->assertCount(0, $resultWithContainerLevelAccess->getMetadata()); } /** From 05b15f4b91849531d2f146cdabade3ac0c3de9c6 Mon Sep 17 00:00:00 2001 From: Xiaoning Liu Date: Thu, 14 Sep 2017 18:22:19 +0800 Subject: [PATCH 09/11] GetBlobOptions and ListPageBlobRangesOptions now provide setRange() and getRange() to accept a Range object. --- BreakingChanges.md | 12 +++- ChangeLog.md | 13 +++- samples/BlobSamples.php | 6 +- samples/TableSamples.php | 1 - src/Blob/BlobRestProxy.php | 33 +++++---- src/Blob/Models/GetBlobOptions.php | 68 ++++++------------- src/Blob/Models/ListPageBlobRangesOptions.php | 52 ++++---------- .../Blob/BlobServiceFunctionalTest.php | 42 ++++++------ .../Blob/BlobServiceFunctionalTestData.php | 18 +++-- tests/Unit/Blob/BlobRestProxyTest.php | 8 +-- tests/Unit/Blob/Models/GetBlobOptionsTest.php | 54 +++++---------- .../Models/ListPageBlobRangesOptionsTest.php | 34 +++------- 12 files changed, 141 insertions(+), 200 deletions(-) diff --git a/BreakingChanges.md b/BreakingChanges.md index 0ea4d053e..bc85b562e 100644 --- a/BreakingChanges.md +++ b/BreakingChanges.md @@ -1,5 +1,15 @@ Blob -* Populate content MD5 for range gets on Blobs. The content MD5 returned for range gets on Blobs will be the value of the whole blob’s MD5 value. +* Populate content MD5 for range gets on Blobs. + - `MicrosoftAzure\Storage\Blob\Models\BlobProperties::getContentMD5()` will always return the value of the whole blob’s MD5 value. + - Added `MicrosoftAzure\Storage\Blob\Models\BlobProperties::getRangeContentMD5()` to get MD5 of a blob range. +* `MicrosoftAzure\Storage\Blob\Models\GetBlobOptions` and `MicrosoftAzure\Storage\Blob\Models\ListPageBlobRangesOptions` now provide `setRange()` and `getRange()` to accept a `MicrosoftAzure\Storage\Common\Models\Range` object. Following methods are removed: + - `setRangeStart()` + - `getRangeStart()` + - `setRangeEnd()` + - `getRangeEnd()` +* Renamed 2 methods inside `MicrosoftAzure\Storage\Blob\Models\GetBlobOptions`: + - `getComputeRangeMD5()` -> `getRangeGetContentMD5()` + - `setComputeRangeMD5()` -> `setRangeGetContentMD5()` File * Populate content MD5 for range gets on Files. The content MD5 returned for range gets on Files will be the value of the whole file’s MD5 value. diff --git a/ChangeLog.md b/ChangeLog.md index ae3ac0a62..a5e86c093 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,10 +3,19 @@ * Fixed wrong `XmlSerializer` in ServiceException.php. * Added support for Incremental Copy Page Blob. This allows efficient copying and backup of page blob snapshots. * Fixed a bug that `BlobRestProxy::createPageBlobFromContent` cannot work. -* Populate content MD5 for range gets on Blobs. The content MD5 returned for range gets on Blobs will be the value of the whole blob’s MD5 value. -* Populate content MD5 for range gets on Files. The content MD5 returned for range gets on Files will be the value of the whole file’s MD5 value. +* Populate content MD5 for range gets on Blobs. + - `MicrosoftAzure\Storage\Blob\Models\BlobProperties::getContentMD5()` will always return the value of the whole blob’s MD5 value. + - Added `MicrosoftAzure\Storage\Blob\Models\BlobProperties::getRangeContentMD5()` to get MD5 of a blob range. * Fixed a bug that setting content MD5 cannot work when creating files. * The public access level of a container is now returned from the List Containers and Get Container Properties APIs. +* `MicrosoftAzure\Storage\Blob\Models\GetBlobOptions` and `MicrosoftAzure\Storage\Blob\Models\ListPageBlobRangesOptions` now provide `setRange()` and `getRange()` to accept a `MicrosoftAzure\Storage\Common\Models\Range` object. Following methods are removed: + - `setRangeStart()` + - `getRangeStart()` + - `setRangeEnd()` + - `getRangeEnd()` +* Renamed 2 methods inside `MicrosoftAzure\Storage\Blob\Models\GetBlobOptions`: + - `getComputeRangeMD5()` -> `getRangeGetContentMD5()` + - `setComputeRangeMD5()` -> `setRangeGetContentMD5()` 2017.08 - version 0.18.0 diff --git a/samples/BlobSamples.php b/samples/BlobSamples.php index 459da31db..ac819ff29 100644 --- a/samples/BlobSamples.php +++ b/samples/BlobSamples.php @@ -519,8 +519,7 @@ function pageBlobOperations($blobClient) ); # List page blob ranges $listPageBlobRangesOptions = new ListPageBlobRangesOptions(); - $listPageBlobRangesOptions->setRangeStart(0); - $listPageBlobRangesOptions->setRangeEnd(1023); + $listPageBlobRangesOptions->setRange(new Range(0, 1023)); echo "List Page Blob Ranges".PHP_EOL; $listPageBlobRangesResult = $blobClient->listPageBlobRanges( $containerName, @@ -531,8 +530,7 @@ function pageBlobOperations($blobClient) foreach ($listPageBlobRangesResult->getRanges() as $range) { echo "Range:".$range->getStart()."-".$range->getEnd().PHP_EOL; $getBlobOptions = new GetBlobOptions(); - $getBlobOptions->setRangeStart($range->getStart()); - $getBlobOptions->setRangeEnd($range->getEnd()); + $getBlobOptions->setRange($range); $getBlobResult = $blobClient->getBlob($containerName, $blobName, $getBlobOptions); file_put_contents("PageContent.txt", $getBlobResult->getContentStream()); } diff --git a/samples/TableSamples.php b/samples/TableSamples.php index 7283102ce..b82cc6ba5 100644 --- a/samples/TableSamples.php +++ b/samples/TableSamples.php @@ -40,7 +40,6 @@ use MicrosoftAzure\Storage\Common\SharedAccessSignatureHelper; $connectionString = 'DefaultEndpointsProtocol=https;AccountName=;AccountKey='; -$connectionString = 'DefaultEndpointsProtocol=https;AccountName=browserifytest;AccountKey=AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=browserifytest;AccountKey=bzcVslAQI9EaR4R0HN78Rs4rjKotuAvCTto9rRlEcpVtVXt0gxzxv/ky4IQkX3N9xN7iAXLzYWn5Yk+5jYkBLg=='; $tableClient = ServicesBuilder::getInstance()->createTableService($connectionString); $mytable = 'mytable'; diff --git a/src/Blob/BlobRestProxy.php b/src/Blob/BlobRestProxy.php index e927bfa94..b292e98ea 100644 --- a/src/Blob/BlobRestProxy.php +++ b/src/Blob/BlobRestProxy.php @@ -3049,13 +3049,16 @@ private function listPageBlobRangesAsyncImpl( $headers, $options->getAccessConditions() ); - - $headers = $this->addOptionalRangeHeader( - $headers, - $options->getRangeStart(), - $options->getRangeEnd() - ); - + + $range = $options->getRange(); + if ($range) { + $headers = $this->addOptionalRangeHeader( + $headers, + $range->getStart(), + $range->getEnd() + ); + } + $this->addOptionalHeader( $headers, Resources::X_MS_LEASE_ID, @@ -3459,16 +3462,20 @@ public function getBlobAsync( $options = new GetBlobOptions(); } - $getMD5 = $options->getComputeRangeMD5(); + $getMD5 = $options->getRangeGetContentMD5(); $headers = $this->addOptionalAccessConditionHeader( $headers, $options->getAccessConditions() ); - $headers = $this->addOptionalRangeHeader( - $headers, - $options->getRangeStart(), - $options->getRangeEnd() - ); + + $range = $options->getRange(); + if ($range) { + $headers = $this->addOptionalRangeHeader( + $headers, + $range->getStart(), + $range->getEnd() + ); + } $this->addOptionalHeader( $headers, diff --git a/src/Blob/Models/GetBlobOptions.php b/src/Blob/Models/GetBlobOptions.php index 498df5972..20ee494d3 100644 --- a/src/Blob/Models/GetBlobOptions.php +++ b/src/Blob/Models/GetBlobOptions.php @@ -25,6 +25,7 @@ namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\Validate; +use MicrosoftAzure\Storage\Common\Models\Range; /** * Optional parameters for getBlob wrapper @@ -39,9 +40,8 @@ class GetBlobOptions extends BlobServiceOptions { private $snapshot; - private $computeRangeMD5; - private $rangeStart; - private $rangeEnd; + private $range; + private $rangeGetContentMD5; /** * Gets blob snapshot. @@ -64,73 +64,49 @@ public function setSnapshot($snapshot) { $this->snapshot = $snapshot; } - - /** - * Gets rangeStart - * - * @return integer - */ - public function getRangeStart() - { - return $this->rangeStart; - } - - /** - * Sets rangeStart - * - * @param integer $rangeStart the blob lease id. - * - * @return void - */ - public function setRangeStart($rangeStart) - { - Validate::isInteger($rangeStart, 'rangeStart'); - $this->rangeStart = $rangeStart; - } - + /** - * Gets rangeEnd + * Gets Blob range. * - * @return integer + * @return Range */ - public function getRangeEnd() + public function getRange() { - return $this->rangeEnd; + return $this->range; } - + /** - * Sets rangeEnd + * Sets Blob range. * - * @param integer $rangeEnd range end value in bytes + * @param Range $range value. * * @return void */ - public function setRangeEnd($rangeEnd) + public function setRange(Range $range) { - Validate::isInteger($rangeEnd, 'rangeEnd'); - $this->rangeEnd = $rangeEnd; + $this->range = $range; } - + /** - * Gets computeRangeMD5 + * Gets rangeGetContentMD5 * * @return boolean */ - public function getComputeRangeMD5() + public function getRangeGetContentMD5() { - return $this->computeRangeMD5; + return $this->rangeGetContentMD5; } /** - * Sets computeRangeMD5 + * Sets rangeGetContentMD5 * - * @param boolean $computeRangeMD5 value + * @param boolean $rangeGetContentMD5 value * * @return void */ - public function setComputeRangeMD5($computeRangeMD5) + public function setRangeGetContentMD5($rangeGetContentMD5) { - Validate::isBoolean($computeRangeMD5); - $this->computeRangeMD5 = $computeRangeMD5; + Validate::isBoolean($rangeGetContentMD5); + $this->rangeGetContentMD5 = $rangeGetContentMD5; } } diff --git a/src/Blob/Models/ListPageBlobRangesOptions.php b/src/Blob/Models/ListPageBlobRangesOptions.php index b386d9a5d..155cbe43a 100644 --- a/src/Blob/Models/ListPageBlobRangesOptions.php +++ b/src/Blob/Models/ListPageBlobRangesOptions.php @@ -25,6 +25,7 @@ namespace MicrosoftAzure\Storage\Blob\Models; use MicrosoftAzure\Storage\Common\Internal\Validate; +use MicrosoftAzure\Storage\Common\Models\Range; /** * Optional parameters for listPageBlobRanges wrapper @@ -38,7 +39,8 @@ */ class ListPageBlobRangesOptions extends BlobServiceOptions { - private $_snapshot; + private $snapshot; + private $range; private $_rangeStart; private $_rangeEnd; @@ -49,7 +51,7 @@ class ListPageBlobRangesOptions extends BlobServiceOptions */ public function getSnapshot() { - return $this->_snapshot; + return $this->snapshot; } /** @@ -61,52 +63,28 @@ public function getSnapshot() */ public function setSnapshot($snapshot) { - $this->_snapshot = $snapshot; + $this->snapshot = $snapshot; } - - /** - * Gets rangeStart - * - * @return integer - */ - public function getRangeStart() - { - return $this->_rangeStart; - } - - /** - * Sets rangeStart - * - * @param integer $rangeStart the blob lease id. - * - * @return void - */ - public function setRangeStart($rangeStart) - { - Validate::isInteger($rangeStart, 'rangeStart'); - $this->_rangeStart = $rangeStart; - } - + /** - * Gets rangeEnd + * Gets Blob range. * - * @return integer + * @return Range */ - public function getRangeEnd() + public function getRange() { - return $this->_rangeEnd; + return $this->range; } - + /** - * Sets rangeEnd + * Sets Blob range. * - * @param integer $rangeEnd range end value in bytes + * @param Range $range value. * * @return void */ - public function setRangeEnd($rangeEnd) + public function setRange(Range $range) { - Validate::isInteger($rangeEnd, 'rangeEnd'); - $this->_rangeEnd = $rangeEnd; + $this->range = $range; } } diff --git a/tests/Functional/Blob/BlobServiceFunctionalTest.php b/tests/Functional/Blob/BlobServiceFunctionalTest.php index b768e9a33..dd29f6a70 100644 --- a/tests/Functional/Blob/BlobServiceFunctionalTest.php +++ b/tests/Functional/Blob/BlobServiceFunctionalTest.php @@ -2147,7 +2147,7 @@ private function getBlobWorker($options, $container) // Make sure there is something to test $dataSize = 512; $createBlobOptions = new CreateBlobOptions(); - if ($options && $options->getComputeRangeMD5()) { + if ($options && $options->getRangeGetContentMD5()) { $createBlobOptions->setContentMD5('MDAwMDAwMDA='); } $this->restProxy->createPageBlob($container, $blob, $dataSize, $createBlobOptions); @@ -2182,7 +2182,9 @@ private function getBlobWorker($options, $container) if (!BlobServiceFunctionalTestData::passTemporalAccessCondition($options->getAccessConditions())) { $this->assertTrue(false, 'Expect failing etag access condition to throw'); } - if ($options->getComputeRangeMD5() && is_null($options->getRangeStart())) { + if ($options->getRangeGetContentMD5() && ( + is_null($options->getRange()) || is_null($options->getRange()->getStart()) + )) { $this->assertTrue(false, 'Expect compute range MD5 to fail if range not set'); } @@ -2220,7 +2222,9 @@ private function getBlobWorker($options, $container) $e->getCode(), 'bad etag access condition: getCode' ); - } elseif ($options->getComputeRangeMD5() && is_null($options->getRangeStart())) { + } elseif ($options->getRangeGetContentMD5() && ( + is_null($options->getRange()) || is_null($options->getRange()->getStart()) + )) { $this->assertEquals( TestResources::STATUS_BAD_REQUEST, $e->getCode(), @@ -2243,11 +2247,16 @@ private function verifyGetBlobWorker($res, $options, $dataSize, $metadata) $content = stream_get_contents($res->getContentStream()); $rangeSize = $dataSize; - if (!is_null($options->getRangeEnd())) { - $rangeSize = (int) $options->getRangeEnd() + 1; + $range = $options->getRange(); + if (is_null($range)) { + $range = new Range(null); } - if (!is_null($options->getRangeStart())) { - $rangeSize -= $options->getRangeStart(); + + if (!is_null($range->getEnd())) { + $rangeSize = (int) $range->getEnd() + 1; + } + if (!is_null($range->getStart())) { + $rangeSize -= $range->getStart(); } else { // One might expect that not specifying the start would just take the // first $rangeEnd bytes, but instead the Azure service ignores @@ -2257,7 +2266,7 @@ private function verifyGetBlobWorker($res, $options, $dataSize, $metadata) $this->assertEquals($rangeSize, strlen($content), '$content length and range'); - if ($options->getComputeRangeMD5()) { + if ($options->getRangeGetContentMD5()) { $md5 = 'MDAwMDAwMDA='; $this->assertEquals( $md5, @@ -3335,9 +3344,8 @@ private function putListClearPageRangesWorker( $options ); $getOptions = new GetBlobOptions(); - $getOptions->setRangeStart($putRange->getStart()); - $getOptions->setRangeEnd($putRange->getEnd()); - $getOptions->setComputeRangeMD5(true); + $getOptions->setRange($putRange); + $getOptions->setRangeGetContentMD5(true); $result = $this->restProxy->getBlob($container, $blob, $getOptions); $actualContent = stream_get_contents($result->getContentStream()); $actualMD5 = $result->getProperties()->getRangeContentMD5(); @@ -3350,10 +3358,8 @@ private function putListClearPageRangesWorker( } //Validate result $listRangeOptions = new ListPageBlobRangesOptions(); - if ($listRange != null) { - $listRangeOptions->setRangeStart($listRange->getStart()); - $listRangeOptions->setRangeEnd($listRange->getEnd()); - } + $listRange = is_null($listRange) ? new Range(null) : $listRange; + $listRangeOptions->setRange($listRange); $listResult = $this->restProxy->listPageBlobRanges($container, $blob, $listRangeOptions); $this->assertEquals(2048, $listResult->getContentLength()); @@ -3437,10 +3443,8 @@ private function putListClearPageRangesDiffWorker( //Validate result $listRangeOptions = new ListPageBlobRangesOptions(); - if ($listRange != null) { - $listRangeOptions->setRangeStart($listRange->getStart()); - $listRangeOptions->setRangeEnd($listRange->getEnd()); - } + $listRange = is_null($listRange) ? new Range(null) : $listRange; + $listRangeOptions->setRange($listRange); $listResult = $this->restProxy->listPageBlobRangesDiff($container, $blob, $snapshot, $listRangeOptions); $this->assertEquals($length, $listResult->getContentLength()); diff --git a/tests/Functional/Blob/BlobServiceFunctionalTestData.php b/tests/Functional/Blob/BlobServiceFunctionalTestData.php index ca591ca4a..fdcf3f45a 100644 --- a/tests/Functional/Blob/BlobServiceFunctionalTestData.php +++ b/tests/Functional/Blob/BlobServiceFunctionalTestData.php @@ -795,31 +795,29 @@ public static function getGetBlobOptions() } $options = new GetBlobOptions(); - $options->setRangeStart(50); - $options->setRangeEnd(200); + $options->setRange(new Range(50, 200)); array_push($ret, $options); $options = new GetBlobOptions(); - $options->setRangeStart(50); - $options->setRangeEnd(200); - $options->setComputeRangeMD5(true); + $options->setRange(new Range(50, 200)); + $options->setRangeGetContentMD5(true); array_push($ret, $options); $options = new GetBlobOptions(); - $options->setRangeStart(50); + $options->setRange(new Range(50)); array_push($ret, $options); $options = new GetBlobOptions(); - $options->setComputeRangeMD5(true); + $options->setRangeGetContentMD5(true); array_push($ret, $options); $options = new GetBlobOptions(); - $options->setRangeEnd(200); - $options->setComputeRangeMD5(true); + $options->setRange(new Range(null, 200)); + $options->setRangeGetContentMD5(true); array_push($ret, $options); $options = new GetBlobOptions(); - $options->setRangeEnd(200); + $options->setRange(new Range(null, 200)); array_push($ret, $options); $options = new GetBlobOptions(); diff --git a/tests/Unit/Blob/BlobRestProxyTest.php b/tests/Unit/Blob/BlobRestProxyTest.php index 3672827f1..521632b0d 100644 --- a/tests/Unit/Blob/BlobRestProxyTest.php +++ b/tests/Unit/Blob/BlobRestProxyTest.php @@ -1227,9 +1227,8 @@ public function testGetBlobWithRange() } $this->restProxy->createBlobPages('', $blob, $range, $contentStream); $options = new GetBlobOptions(); - $options->setRangeStart(0); - $options->setRangeEnd(511); - + $options->setRange(new Range(0, 511)); + // Test $result = $this->restProxy->getBlob('', $blob, $options); @@ -1263,8 +1262,7 @@ public function testGetBlobWithEndRange() } $this->restProxy->createBlobPages($name, $blob, $range, $contentStream); $options = new GetBlobOptions(); - $options->setRangeStart(null); - $options->setRangeEnd(511); + $options->setRange(new Range(null, 511)); // Test $result = $this->restProxy->getBlob($name, $blob, $options); diff --git a/tests/Unit/Blob/Models/GetBlobOptionsTest.php b/tests/Unit/Blob/Models/GetBlobOptionsTest.php index 9c2ae4e37..ae87f8370 100644 --- a/tests/Unit/Blob/Models/GetBlobOptionsTest.php +++ b/tests/Unit/Blob/Models/GetBlobOptionsTest.php @@ -23,6 +23,7 @@ */ namespace MicrosoftAzure\Storage\Tests\Unit\Blob\Models; +use MicrosoftAzure\Storage\Common\Models\Range; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Blob\Models\AccessCondition; use MicrosoftAzure\Storage\Blob\Models\GetBlobOptions; @@ -124,69 +125,50 @@ public function testGetSnapshot() } /** - * @covers MicrosoftAzure\Storage\Blob\Models\GetBlobOptions::setRangeStart - * @covers MicrosoftAzure\Storage\Blob\Models\GetBlobOptions::getRangeStart + * @covers MicrosoftAzure\Storage\Blob\Models\GetBlobOptions::setRange + * @covers MicrosoftAzure\Storage\Blob\Models\GetBlobOptions::getRange */ - public function testSetRangeStart() + public function testSetRange() { // Setup - $expected = 123; - $prooperties = new GetBlobOptions(); - $prooperties->setRangeStart($expected); - - // Test - $prooperties->setRangeStart($expected); - - // Assert - $this->assertEquals($expected, $prooperties->getRangeStart()); - } - - /** - * @covers MicrosoftAzure\Storage\Blob\Models\GetBlobOptions::setRangeEnd - * @covers MicrosoftAzure\Storage\Blob\Models\GetBlobOptions::getRangeEnd - */ - public function testSetRangeEnd() - { - // Setup - $expected = 123; - $prooperties = new GetBlobOptions(); - $prooperties->setRangeEnd($expected); - + $expected = new Range(0, 123); + $options = new GetBlobOptions(); + // Test - $prooperties->setRangeEnd($expected); - + $options->setRange($expected); + // Assert - $this->assertEquals($expected, $prooperties->getRangeEnd()); + $this->assertEquals($expected, $options->getRange()); } /** - * @covers MicrosoftAzure\Storage\Blob\Models\GetBlobOptions::setComputeRangeMD5 + * @covers MicrosoftAzure\Storage\Blob\Models\GetBlobOptions::setRangeGetContentMD5 */ - public function testSetComputeRangeMD5() + public function testSetRangeGetContentMD5() { // Setup $options = new GetBlobOptions(); $expected = true; // Test - $options->setComputeRangeMD5($expected); + $options->setRangeGetContentMD5($expected); // Assert - $this->assertEquals($expected, $options->getComputeRangeMD5()); + $this->assertEquals($expected, $options->getRangeGetContentMD5()); } /** - * @covers MicrosoftAzure\Storage\Blob\Models\GetBlobOptions::getComputeRangeMD5 + * @covers MicrosoftAzure\Storage\Blob\Models\GetBlobOptions::getRangeGetContentMD5 */ - public function testGetComputeRangeMD5() + public function testGetRangeGetContentMD5() { // Setup $options = new GetBlobOptions(); $expected = true; - $options->setComputeRangeMD5($expected); + $options->setRangeGetContentMD5($expected); // Test - $actual = $options->getComputeRangeMD5(); + $actual = $options->getRangeGetContentMD5(); // Assert $this->assertEquals($expected, $actual); diff --git a/tests/Unit/Blob/Models/ListPageBlobRangesOptionsTest.php b/tests/Unit/Blob/Models/ListPageBlobRangesOptionsTest.php index 590d9fdb1..0143e78dd 100644 --- a/tests/Unit/Blob/Models/ListPageBlobRangesOptionsTest.php +++ b/tests/Unit/Blob/Models/ListPageBlobRangesOptionsTest.php @@ -25,6 +25,7 @@ use MicrosoftAzure\Storage\Blob\Models\ListPageBlobRangesOptions; use MicrosoftAzure\Storage\Blob\Models\AccessCondition; +use MicrosoftAzure\Storage\Common\Models\Range; use MicrosoftAzure\Storage\Tests\Framework\TestResources; /** @@ -124,38 +125,19 @@ public function testGetSnapshot() } /** - * @covers MicrosoftAzure\Storage\Blob\Models\ListPageBlobRangesOptions::setRangeStart - * @covers MicrosoftAzure\Storage\Blob\Models\ListPageBlobRangesOptions::getRangeStart + * @covers MicrosoftAzure\Storage\Blob\Models\ListPageBlobRangesOptions::setRange + * @covers MicrosoftAzure\Storage\Blob\Models\ListPageBlobRangesOptions::getRange */ - public function testSetRangeStart() + public function testSetRange() { // Setup - $expected = 123; - $prooperties = new ListPageBlobRangesOptions(); - $prooperties->setRangeStart($expected); - - // Test - $prooperties->setRangeStart($expected); - - // Assert - $this->assertEquals($expected, $prooperties->getRangeStart()); - } - - /** - * @covers MicrosoftAzure\Storage\Blob\Models\ListPageBlobRangesOptions::setRangeEnd - * @covers MicrosoftAzure\Storage\Blob\Models\ListPageBlobRangesOptions::getRangeEnd - */ - public function testSetRangeEnd() - { - // Setup - $expected = 123; - $prooperties = new ListPageBlobRangesOptions(); - $prooperties->setRangeEnd($expected); + $expected = new Range(0, 123); + $options = new ListPageBlobRangesOptions(); // Test - $prooperties->setRangeEnd($expected); + $options->setRange($expected); // Assert - $this->assertEquals($expected, $prooperties->getRangeEnd()); + $this->assertEquals($expected, $options->getRange()); } } From 8e83518598053106eee146b1a005768fd831969a Mon Sep 17 00:00:00 2001 From: Xiaoning Liu Date: Thu, 14 Sep 2017 20:01:55 +0800 Subject: [PATCH 10/11] Added CopyBlobFromURL to support copy from source URL including resources in other storage accounts --- ChangeLog.md | 1 + src/Blob/BlobRestProxy.php | 106 +++++++++++--- src/Blob/Internal/IBlob.php | 54 ++++++- src/Blob/Models/CopyBlobFromURLOptions.php | 136 ++++++++++++++++++ src/Blob/Models/CopyBlobOptions.php | 99 +------------ .../Unit/Blob/Models/CopyBlobOptionsTest.php | 27 ++++ 6 files changed, 306 insertions(+), 117 deletions(-) create mode 100644 src/Blob/Models/CopyBlobFromURLOptions.php diff --git a/ChangeLog.md b/ChangeLog.md index a5e86c093..ba73b836c 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -16,6 +16,7 @@ * Renamed 2 methods inside `MicrosoftAzure\Storage\Blob\Models\GetBlobOptions`: - `getComputeRangeMD5()` -> `getRangeGetContentMD5()` - `setComputeRangeMD5()` -> `setRangeGetContentMD5()` +* Added `CopyBlobFromURL` to support copy blob from a source URL including resources in other storage accounts. 2017.08 - version 0.18.0 diff --git a/src/Blob/BlobRestProxy.php b/src/Blob/BlobRestProxy.php index b292e98ea..8f5a690e5 100644 --- a/src/Blob/BlobRestProxy.php +++ b/src/Blob/BlobRestProxy.php @@ -3755,6 +3755,82 @@ public function copyBlobAsync( $sourceContainer, $sourceBlob, Models\CopyBlobOptions $options = null + ) { + if (is_null($options)) { + $options = new CopyBlobOptions(); + } + + $sourceBlobPath = $this->getCopyBlobSourceName( + $sourceContainer, + $sourceBlob, + $options + ); + + return $this->copyBlobFromURLAsync( + $destinationContainer, + $destinationBlob, + $sourceBlobPath, + $options + ); + } + + /** + * Copies from a source URL to a destination blob. + * + * @param string $destinationContainer name of the + * destination + * container + * @param string $destinationBlob name of the + * destination + * blob + * @param string $sourceURL URL of the + * source + * resource + * @param Models\CopyBlobFromURLOptions $options optional + * parameters + * + * @return Models\CopyBlobResult + * + * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd894037.aspx + */ + public function copyBlobFromURL( + $destinationContainer, + $destinationBlob, + $sourceURL, + Models\CopyBlobFromURLOptions $options = null + ) { + return $this->copyBlobFromURLAsync( + $destinationContainer, + $destinationBlob, + $sourceURL, + $options + )->wait(); + } + + /** + * Creates promise to copy from source URL to a destination blob. + * + * @param string $destinationContainer name of the + * destination + * container + * @param string $destinationBlob name of the + * destination + * blob + * @param string $sourceURL URL of the + * source + * resource + * @param Models\CopyBlobFromURLOptions $options optional + * parameters + * + * @return \GuzzleHttp\Promise\PromiseInterface + * + * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd894037.aspx + */ + public function copyBlobFromURLAsync( + $destinationContainer, + $destinationBlob, + $sourceURL, + Models\CopyBlobFromURLOptions $options = null ) { $method = Resources::HTTP_PUT; $headers = array(); @@ -3764,9 +3840,9 @@ public function copyBlobAsync( $destinationContainer, $destinationBlob ); - + if (is_null($options)) { - $options = new CopyBlobOptions(); + $options = new CopyBlobFromURLOptions(); } if ($options->getIsIncrementalCopy()) { @@ -3776,45 +3852,39 @@ public function copyBlobAsync( 'incrementalcopy' ); } - - $sourceBlobPath = $this->getCopyBlobSourceName( - $sourceContainer, - $sourceBlob, - $options - ); - + $headers = $this->addOptionalAccessConditionHeader( $headers, $options->getAccessConditions() ); - + $headers = $this->addOptionalSourceAccessConditionHeader( $headers, $options->getSourceAccessConditions() ); - + $this->addOptionalHeader( $headers, Resources::X_MS_COPY_SOURCE, - $sourceBlobPath + $sourceURL ); - + $headers = $this->addMetadataHeaders($headers, $options->getMetadata()); - + $this->addOptionalHeader( $headers, Resources::X_MS_LEASE_ID, $options->getLeaseId() ); - + $this->addOptionalHeader( $headers, Resources::X_MS_SOURCE_LEASE_ID, $options->getSourceLeaseId() ); - + $options->setLocationMode(LocationMode::PRIMARY_ONLY); - + return $this->sendAsync( $method, $headers, @@ -3830,7 +3900,7 @@ public function copyBlobAsync( ); }, null); } - + /** * Abort a blob copy operation * diff --git a/src/Blob/Internal/IBlob.php b/src/Blob/Internal/IBlob.php index f736271bf..e2d5a4341 100644 --- a/src/Blob/Internal/IBlob.php +++ b/src/Blob/Internal/IBlob.php @@ -1253,7 +1253,59 @@ public function copyBlobAsync( $sourceBlob, BlobModels\CopyBlobOptions $options = null ); - + + /** + * Copies from a source URL to a destination blob. + * + * @param string $destinationContainer name of the + * destination + * container + * @param string $destinationBlob name of the + * destination + * blob + * @param string $sourceURL URL of the + * source + * resource + * @param BlobModels\CopyBlobFromURLOptions $options optional + * parameters + * + * @return BlobModels\CopyBlobResult + * + * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd894037.aspx + */ + public function copyBlobFromURL( + $destinationContainer, + $destinationBlob, + $sourceURL, + BlobModels\CopyBlobFromURLOptions $options = null + ); + + /** + * Creates promise to copy from source URL to a destination blob. + * + * @param string $destinationContainer name of the + * destination + * container + * @param string $destinationBlob name of the + * destination + * blob + * @param string $sourceURL URL of the + * source + * resource + * @param BlobModels\CopyBlobFromURLOptions $options optional + * parameters + * + * @return \GuzzleHttp\Promise\PromiseInterface + * + * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd894037.aspx + */ + public function copyBlobFromURLAsync( + $destinationContainer, + $destinationBlob, + $sourceURL, + BlobModels\CopyBlobFromURLOptions $options = null + ); + /** * Abort a blob copy operation * diff --git a/src/Blob/Models/CopyBlobFromURLOptions.php b/src/Blob/Models/CopyBlobFromURLOptions.php new file mode 100644 index 000000000..cf0af8a58 --- /dev/null +++ b/src/Blob/Models/CopyBlobFromURLOptions.php @@ -0,0 +1,136 @@ + + * @copyright 2017 Microsoft Corporation + * @license https://github.com/azure/azure-storage-php/LICENSE + * @link https://github.com/azure/azure-storage-php + */ + +namespace MicrosoftAzure\Storage\Blob\Models; + +/** + * optional parameters for CopyBlobOptions wrapper + * + * @category Microsoft + * @package MicrosoftAzure\Storage\Blob\Models + * @author Azure Storage PHP SDK + * @copyright 2017 Microsoft Corporation + * @license https://github.com/azure/azure-storage-php/LICENSE + * @link https://github.com/azure/azure-storage-php + */ +class CopyBlobFromURLOptions extends BlobServiceOptions +{ + private $sourceLeaseId; + private $sourceAccessConditions; + private $metadata; + private $isIncrementalCopy; + + /** + * Gets source access condition + * + * @return AccessCondition[] + */ + public function getSourceAccessConditions() + { + return $this->sourceAccessConditions; + } + + /** + * Sets source access condition + * + * @param array $sourceAccessConditions value to use. + * + * @return void + */ + public function setSourceAccessConditions($sourceAccessConditions) + { + if (!is_null($sourceAccessConditions) && + is_array($sourceAccessConditions)) { + $this->sourceAccessConditions = $sourceAccessConditions; + } else { + $this->sourceAccessConditions = [$sourceAccessConditions]; + } + } + + /** + * Gets metadata. + * + * @return array + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Sets metadata. + * + * @param array $metadata value. + * + * @return void + */ + public function setMetadata(array $metadata) + { + $this->metadata = $metadata; + } + + /** + * Gets source lease ID. + * + * @return string + */ + public function getSourceLeaseId() + { + return $this->sourceLeaseId; + } + + /** + * Sets source lease ID. + * + * @param string $sourceLeaseId value. + * + * @return void + */ + public function setSourceLeaseId($sourceLeaseId) + { + $this->sourceLeaseId = $sourceLeaseId; + } + + /** + * Gets isIncrementalCopy. + * + * @return boolean + */ + public function getIsIncrementalCopy() + { + return $this->isIncrementalCopy; + } + + /** + * Sets isIncrementalCopy. + * + * @param boolean $isIncrementalCopy + * + * @return void + */ + public function setIsIncrementalCopy($isIncrementalCopy) + { + $this->isIncrementalCopy = $isIncrementalCopy; + } +} diff --git a/src/Blob/Models/CopyBlobOptions.php b/src/Blob/Models/CopyBlobOptions.php index 2db7270ad..b46d70ee4 100644 --- a/src/Blob/Models/CopyBlobOptions.php +++ b/src/Blob/Models/CopyBlobOptions.php @@ -34,63 +34,10 @@ * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ -class CopyBlobOptions extends BlobServiceOptions +class CopyBlobOptions extends CopyBlobFromURLOptions { - private $sourceLeaseId; - private $sourceAccessConditions; - private $metadata; private $sourceSnapshot; - private $isIncrementalCopy; - - /** - * Gets source access condition - * - * @return AccessCondition[] - */ - public function getSourceAccessConditions() - { - return $this->sourceAccessConditions; - } - - /** - * Sets source access condition - * - * @param array $sourceAccessCondition value to use. - * - * @return void - */ - public function setSourceAccessConditions($sourceAccessConditions) - { - if (!is_null($sourceAccessConditions) && - is_array($sourceAccessConditions)) { - $this->sourceAccessConditions = $sourceAccessConditions; - } else { - $this->sourceAccessConditions = [$sourceAccessConditions]; - } - } - - /** - * Gets metadata. - * - * @return array - */ - public function getMetadata() - { - return $this->metadata; - } - /** - * Sets metadata. - * - * @param array $metadata value. - * - * @return void - */ - public function setMetadata(array $metadata) - { - $this->metadata = $metadata; - } - /** * Gets source snapshot. * @@ -112,48 +59,4 @@ public function setSourceSnapshot($sourceSnapshot) { $this->sourceSnapshot = $sourceSnapshot; } - - /** - * Gets source lease ID. - * - * @return string - */ - public function getSourceLeaseId() - { - return $this->sourceLeaseId; - } - - /** - * Sets source lease ID. - * - * @param string $sourceLeaseId value. - * - * @return void - */ - public function setSourceLeaseId($sourceLeaseId) - { - $this->sourceLeaseId = $sourceLeaseId; - } - - /** - * Gets isIncrementalCopy. - * - * @return boolean - */ - public function getIsIncrementalCopy() - { - return $this->isIncrementalCopy; - } - - /** - * Sets isIncrementalCopy. - * - * @param boolean $isIncrementalCopy - * - * @return boolean - */ - public function setIsIncrementalCopy($isIncrementalCopy) - { - $this->isIncrementalCopy = $isIncrementalCopy; - } } diff --git a/tests/Unit/Blob/Models/CopyBlobOptionsTest.php b/tests/Unit/Blob/Models/CopyBlobOptionsTest.php index 1fcb79c4f..44ee2559a 100644 --- a/tests/Unit/Blob/Models/CopyBlobOptionsTest.php +++ b/tests/Unit/Blob/Models/CopyBlobOptionsTest.php @@ -41,6 +41,8 @@ class CopyBlobOptionsTest extends \PHPUnit_Framework_TestCase { /** + * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobFromURLOptions::setMetadata + * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobFromURLOptions::getMetadata * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobOptions::setMetadata * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobOptions::getMetadata */ @@ -57,6 +59,8 @@ public function testSetMetadata() } /** + * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobFromURLOptions::setAccessConditions + * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobFromURLOptions::getAccessConditions * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobOptions::setAccessConditions * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobOptions::getAccessConditions */ @@ -73,6 +77,8 @@ public function testSetAccessConditions() } /** + * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobFromURLOptions::setSourceAccessConditions + * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobFromURLOptions::getSourceAccessConditions * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobOptions::setSourceAccessConditions * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobOptions::getSourceAccessConditions */ @@ -89,6 +95,8 @@ public function testSetSourceAccessConditions() } /** + * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobFromURLOptions::setLeaseId + * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobFromURLOptions::getLeaseId * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobOptions::setLeaseId * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobOptions::getLeaseId */ @@ -102,6 +110,8 @@ public function testSetLeaseId() } /** + * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobFromURLOptions::setSourceLeaseId + * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobFromURLOptions::getSourceLeaseId * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobOptions::setSourceLeaseId * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobOptions::getSourceLeaseId */ @@ -115,6 +125,8 @@ public function testSetSourceLeaseId() } /** + * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobFromURLOptions::setIsIncrementalCopy + * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobFromURLOptions::getIsIncrementalCopy * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobOptions::setIsIncrementalCopy * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobOptions::getIsIncrementalCopy */ @@ -126,4 +138,19 @@ public function testSetIsIncrementalCopy() $options->setIsIncrementalCopy($expected); $this->assertEquals($expected, $options->getIsIncrementalCopy()); } + + /** + * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobFromURLOptions::setSourceSnapshot + * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobFromURLOptions::getSourceSnapshot + * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobOptions::setSourceSnapshot + * @covers MicrosoftAzure\Storage\Blob\Models\CopyBlobOptions::getSourceSnapshot + */ + public function testSetSourceSnapshot() + { + $expected = '2017-09-19T10:39:36.8401215Z'; + $options = new CopyBlobOptions(); + + $options->setSourceSnapshot($expected); + $this->assertEquals($expected, $options->getSourceSnapshot()); + } } From 29a932962e671001c7fa75aaf74e5470efacd807 Mon Sep 17 00:00:00 2001 From: Xiaoning Liu Date: Thu, 14 Sep 2017 20:24:50 +0800 Subject: [PATCH 11/11] Updated version number and changelog --- BreakingChanges.md | 6 +++++- ChangeLog.md | 28 +++++++++++++++++++++------- src/Common/Internal/Resources.php | 2 +- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/BreakingChanges.md b/BreakingChanges.md index bc85b562e..9d2b8604d 100644 --- a/BreakingChanges.md +++ b/BreakingChanges.md @@ -1,3 +1,5 @@ +Tracking Breaking changes in 0.19.0 + Blob * Populate content MD5 for range gets on Blobs. - `MicrosoftAzure\Storage\Blob\Models\BlobProperties::getContentMD5()` will always return the value of the whole blob’s MD5 value. @@ -12,7 +14,9 @@ Blob - `setComputeRangeMD5()` -> `setRangeGetContentMD5()` File -* Populate content MD5 for range gets on Files. The content MD5 returned for range gets on Files will be the value of the whole file’s MD5 value. +* Populate content MD5 for range gets on Files. + - `MicrosoftAzure\Storage\File\Models\FileProperties::getContentMD5()` will always return the value of the whole file’s MD5 value. + - Added `MicrosoftAzure\Storage\File\Models\FileProperties::getRangeContentMD5()` to get MD5 of a file range. Tracking Breaking changes in 0.17.0 diff --git a/ChangeLog.md b/ChangeLog.md index ba73b836c..0dd44b694 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,22 +1,36 @@ -* Option parameter `ListDirectoriesAndFilesOptions` of `FileRestProxy::listDirectoriesAndFiles` is now able to set a prefix which limits the listing to a specified prefix. -* The `BlobRestProxy::createMessage` now returns information about the message that was just added, including the pop receipt. +2017.09 - version 0.19.0 + +ALL * Fixed wrong `XmlSerializer` in ServiceException.php. +* Fixed formatting of non-UTC dates when using instances of `DateTime` to generate shared access signatures. +* Fixed class loading errors on case-sensitive file systems when testing. + +Blob +* Added `CopyBlobFromURL` to support copy blob from a source URL including resources in other storage accounts. * Added support for Incremental Copy Page Blob. This allows efficient copying and backup of page blob snapshots. * Fixed a bug that `BlobRestProxy::createPageBlobFromContent` cannot work. * Populate content MD5 for range gets on Blobs. - `MicrosoftAzure\Storage\Blob\Models\BlobProperties::getContentMD5()` will always return the value of the whole blob’s MD5 value. - Added `MicrosoftAzure\Storage\Blob\Models\BlobProperties::getRangeContentMD5()` to get MD5 of a blob range. -* Fixed a bug that setting content MD5 cannot work when creating files. +* Renamed 2 methods inside `MicrosoftAzure\Storage\Blob\Models\GetBlobOptions`: + - `getComputeRangeMD5()` -> `getRangeGetContentMD5()` + - `setComputeRangeMD5()` -> `setRangeGetContentMD5()` * The public access level of a container is now returned from the List Containers and Get Container Properties APIs. * `MicrosoftAzure\Storage\Blob\Models\GetBlobOptions` and `MicrosoftAzure\Storage\Blob\Models\ListPageBlobRangesOptions` now provide `setRange()` and `getRange()` to accept a `MicrosoftAzure\Storage\Common\Models\Range` object. Following methods are removed: - `setRangeStart()` - `getRangeStart()` - `setRangeEnd()` - `getRangeEnd()` -* Renamed 2 methods inside `MicrosoftAzure\Storage\Blob\Models\GetBlobOptions`: - - `getComputeRangeMD5()` -> `getRangeGetContentMD5()` - - `setComputeRangeMD5()` -> `setRangeGetContentMD5()` -* Added `CopyBlobFromURL` to support copy blob from a source URL including resources in other storage accounts. + +Queue +* The `QueueRestProxy::createMessage` now returns information about the message that was just added, including the pop receipt. + +File +* Fixed a bug that setting content MD5 cannot work when creating files. +* Option parameter `ListDirectoriesAndFilesOptions` of `FileRestProxy::listDirectoriesAndFiles` is now able to set a prefix which limits the listing to a specified prefix. +* Populate content MD5 for range gets on Files. + - `MicrosoftAzure\Storage\File\Models\FileProperties::getContentMD5()` will always return the value of the whole file’s MD5 value. + - Added `MicrosoftAzure\Storage\File\Models\FileProperties::getRangeContentMD5()` to get MD5 of a file range. 2017.08 - version 0.18.0 diff --git a/src/Common/Internal/Resources.php b/src/Common/Internal/Resources.php index a58a2ea5b..48b855f64 100644 --- a/src/Common/Internal/Resources.php +++ b/src/Common/Internal/Resources.php @@ -307,7 +307,7 @@ class Resources const DEAFULT_RETRY_INTERVAL = 1000;//Milliseconds // Header values - const SDK_VERSION = '0.18.0'; + const SDK_VERSION = '0.19.0'; const STORAGE_API_LATEST_VERSION = '2016-05-31'; const DATA_SERVICE_VERSION_VALUE = '3.0'; const MAX_DATA_SERVICE_VERSION_VALUE = '3.0;NetFx';