Skip to content

Commit

Permalink
added test for common prefixes (getObjectsAndPrefixesByBucket())
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnott committed Nov 21, 2011
1 parent 9135b58 commit 7514c3a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/Zend/Service/Amazon/S3/OnlineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,20 @@ public function testGetObjectsByBucketParams()
$this->_amazon->removeObject("testgetobjectparams1/zftest2", "testdata");
$this->_amazon->removeBucket("testgetobjectparams1");
}

public function testCommonPrefixes()
{
$this->_amazon->createBucket($this->_bucket);
$this->_amazon->putObject($this->_bucket.'/test-folder/test1','test');
$this->_amazon->putObject($this->_bucket.'/test-folder/test2-folder/','');
$params= array(
'prefix' => 'test-folder/',
'delimiter' => '/'
);
$response= $this->_amazon->getObjectsAndPrefixesByBucket($this->_bucket,$params);
$this->assertEquals($response['objects'][0],'test-folder/test1');
$this->assertEquals($response['prefixes'][0],'test-folder/test2-folder/');
}

public function tearDown()
{
Expand Down

0 comments on commit 7514c3a

Please sign in to comment.