File tree 2 files changed +21
-2
lines changed
lib/OpenCloud/ObjectStore
tests/OpenCloud/Tests/ObjectStore
2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ public function listContainers(array $filter = array())
92
92
*/
93
93
public function getContainer ($ data = null )
94
94
{
95
- if (is_string ($ data )) {
95
+ if (is_string ($ data ) || is_numeric ( $ data ) ) {
96
96
$ this ->checkContainerName ($ data );
97
97
}
98
98
Original file line number Diff line number Diff line change @@ -123,6 +123,24 @@ public function test_Get_Bad_Container_Name_Long()
123
123
$ this ->service ->getContainer (str_repeat ('a ' , Service::MAX_CONTAINER_NAME_LENGTH + 1 ));
124
124
}
125
125
126
+ /**
127
+ * @expectedException OpenCloud\Common\Exceptions\InvalidArgumentError
128
+ */
129
+ public function test_Get_Bad_Container_Name_Float ()
130
+ {
131
+ $ this ->service ->getContainer (4.5 );
132
+ }
133
+
134
+ public function test_Get_Container_String ()
135
+ {
136
+ $ this ->assertInstanceOf ('OpenCloud\ObjectStore\Resource\Container ' , $ this ->service ->getContainer ('foo ' ));
137
+ }
138
+
139
+ public function test_Get_Container_Integer ()
140
+ {
141
+ $ this ->assertInstanceOf ('OpenCloud\ObjectStore\Resource\Container ' , $ this ->service ->getContainer (1 ));
142
+ }
143
+
126
144
public function test_Bulk_Extract ()
127
145
{
128
146
$ response = $ this ->service ->bulkExtract ('fooBarContainer ' , 'CONTENT ' , UrlType::TAR );
@@ -166,7 +184,8 @@ public function test_Batch_Delete_Returns_Array_Of_Responses()
166
184
{
167
185
$ responses = array_fill (0 , 2 , new Response (200 ));
168
186
169
- foreach ($ responses as $ response ) {
187
+ foreach ($ responses as $ response )
188
+ {
170
189
$ this ->addMockSubscriber ($ response );
171
190
}
172
191
You can’t perform that action at this time.
0 commit comments