Add lacking cleanup for some objects created.
Signed-off-by: Bernd.Rederlechner@t-systems.com <bernd.rederlechner@t-systems.com>
This commit is contained in:
parent
f2256a2c11
commit
b5dfb01dc5
|
@ -123,5 +123,8 @@ abstract class ObjectStoreTest extends TestCase {
|
||||||
$this->assertTrue($instance->objectExists('target'));
|
$this->assertTrue($instance->objectExists('target'));
|
||||||
|
|
||||||
$this->assertEquals('foobar', stream_get_contents($instance->readObject('target')));
|
$this->assertEquals('foobar', stream_get_contents($instance->readObject('target')));
|
||||||
|
|
||||||
|
$instance->deleteObject('source');
|
||||||
|
$instance->deleteObject('target');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,6 +81,8 @@ class S3Test extends ObjectStoreTest {
|
||||||
$result = $s3->readObject('multiparttest');
|
$result = $s3->readObject('multiparttest');
|
||||||
|
|
||||||
$this->assertEquals(file_get_contents(__FILE__), stream_get_contents($result));
|
$this->assertEquals(file_get_contents(__FILE__), stream_get_contents($result));
|
||||||
|
|
||||||
|
$s3->deleteObject('multiparttest');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSeek() {
|
public function testSeek() {
|
||||||
|
@ -97,6 +99,8 @@ class S3Test extends ObjectStoreTest {
|
||||||
|
|
||||||
fseek($read, 100, SEEK_CUR);
|
fseek($read, 100, SEEK_CUR);
|
||||||
$this->assertEquals(substr($data, 210, 100), fread($read, 100));
|
$this->assertEquals(substr($data, 210, 100), fread($read, 100));
|
||||||
|
|
||||||
|
$instance->deleteObject('seek');
|
||||||
}
|
}
|
||||||
|
|
||||||
function assertNoUpload($objectUrn) {
|
function assertNoUpload($objectUrn) {
|
||||||
|
@ -110,19 +114,21 @@ class S3Test extends ObjectStoreTest {
|
||||||
$this->assertArrayNotHasKey('Uploads', $uploads);
|
$this->assertArrayNotHasKey('Uploads', $uploads);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testMultipartException() {
|
public function testEmptyUpload() {
|
||||||
//$this->expectException(S3MultipartUploadException::class);
|
//$this->expectException(S3MultipartUploadException::class);
|
||||||
$s3 = $this->getInstance();
|
$s3 = $this->getInstance();
|
||||||
|
|
||||||
// create an empty stream and check that it fits to the
|
// create an empty stream and check that it fits to the
|
||||||
// pre-conditions in writeObject for the empty case
|
// pre-conditions in writeObject for the empty case
|
||||||
$stupidStream = fopen("php://memory", "r");
|
$emptyStream = fopen("php://memory", "r");
|
||||||
fwrite($stupidStream, NULL);
|
fwrite($emptyStream, NULL);
|
||||||
|
|
||||||
$s3->writeObject('stupidstream', $stupidStream);
|
$s3->writeObject('emptystream', $emptyStream);
|
||||||
|
|
||||||
// this method intendedly produces an S3Exception
|
// this method intendedly produces an S3Exception
|
||||||
$this->assertNoUpload('stupidstream');
|
$this->assertNoUpload('emptystream');
|
||||||
}
|
$this->assertTrue($s3->objectExists('emptystream'));
|
||||||
|
|
||||||
|
$s3->deleteObject('emptystream');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue