Fixed the last broken unit test.

This commit is contained in:
Matt Butcher
2012-01-05 10:55:17 -06:00
parent cc2e356330
commit a23ee65692

View File

@@ -9,6 +9,8 @@ namespace HPCloud\Tests\Storage;
require_once 'src/HPCloud/Bootstrap.php';
require_once 'test/TestCase.php';
use \HPCloud\Storage\ObjectStorage\Object;
class ObjectStorageTest extends \HPCloud\Tests\TestCase {
@@ -148,12 +150,21 @@ class ObjectStorageTest extends \HPCloud\Tests\TestCase {
$this->assertNotEmpty($testCollection);
$store = $this->auth();
$ret = $store->createContainer($testCollection);
$this->assertTrue($store->hasContainer($testCollection));
$store->createContainer($testCollection);
$ret = $store->deleteContainer($testCollection);
$container = $store->container($testCollection);
$container->save(new Object('test', 'test', 'text/plain'));
$this->assertTrue($ret);
try {
$ret = $store->deleteContainer($testCollection);
}
catch (\Exception $e) {
$container->delete('test');
$store->deleteContainer($testCollection);
throw $e;
}
$container->delete('test');
$store->deleteContainer($testCollection);
}
}