Story #436: As a user I can remove an object from swift.
This commit is contained in:
@@ -260,11 +260,16 @@ class Container implements \Countable {
|
||||
$client = \HPCloud\Transport::instance();
|
||||
|
||||
try {
|
||||
print $url;
|
||||
$response = $client->doRequest($url, 'DELETE', $headers);
|
||||
}
|
||||
catch (\HPCloud\Transport\FileNotFoundException $fnfe) {
|
||||
return FALSE;
|
||||
}
|
||||
catch (\HPCloud\Transport\MethodNotAllowedException $e) {
|
||||
$e->setMessage('DELETE ' . $url);
|
||||
throw $e;
|
||||
}
|
||||
|
||||
if ($response->status() != 204) {
|
||||
throw new \HPCloud\Exception("An unknown exception occured while deleting $name.");
|
||||
|
||||
@@ -113,8 +113,11 @@ class ContainerTest extends \HPCloud\Tests\TestCase {
|
||||
|
||||
$ret = $container->delete(self::FNAME);
|
||||
|
||||
$fail = $container->delete('no_such_file.txt');
|
||||
|
||||
$this->destroyContainerFixture();
|
||||
$this->assertTrue($ret);
|
||||
$this->assertFalse($fail);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user