@@ -229,23 +229,19 @@ public function test_Upload_Multiple()
229229 public function test_Upload_Multiple_Return_DataObject_Array ()
230230 {
231231 $ tempFileName = tempnam (sys_get_temp_dir (), "php-opencloud-test- " );
232- try {
233- $ tempFile = fopen ($ tempFileName , 'w+ ' );
234- fwrite ($ tempFile , 'BAZQUX ' );
235-
236- $ container = $ this ->container ;
237-
238- $ dataObjects = $ container ->uploadObjects (array (
239- array ('name ' => 'test1 ' , 'body ' => 'FOOBAR ' ),
240- array ('name ' => 'test2 ' , 'path ' => $ tempFileName ),
241- array ('name ' => 'test2 ' , 'body ' => 'BARBAR ' )
242- ), array (), ReturnType::DATA_OBJECT_ARRAY );
243- } catch (Exception $ e ) {
244- throw $ e ;
245- } finally {
246- fclose ($ tempFile );
247- unlink ($ tempFileName );
248- }
232+
233+ $ tempFile = fopen ($ tempFileName , 'w+ ' );
234+ fwrite ($ tempFile , 'BAZQUX ' );
235+
236+ $ container = $ this ->container ;
237+
238+ $ dataObjects = $ container ->uploadObjects (array (
239+ array ('name ' => 'test1 ' , 'body ' => 'FOOBAR ' ),
240+ array ('name ' => 'test2 ' , 'path ' => $ tempFileName ),
241+ array ('name ' => 'test2 ' , 'body ' => 'BARBAR ' )
242+ ), array (), ReturnType::DATA_OBJECT_ARRAY );
243+ fclose ($ tempFile );
244+ unlink ($ tempFileName );
249245
250246 $ this ->assertInstanceOf ('OpenCloud\ObjectStore\Resource\DataObject ' , $ dataObjects [0 ]);
251247 $ this ->assertEquals ('test1 ' , $ dataObjects [0 ]->getName ());
0 commit comments