Skip to content

Commit 3ae1c70

Browse files
committed
Duh! PHP5.4 and below don't support finally at all. Removing altogether :(
1 parent 22aabaf commit 3ae1c70

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

tests/OpenCloud/Tests/ObjectStore/Resource/ContainerTest.php

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)