public function setUp()
 {
     $this->bucket = self::getResourcePrefix() . '-s3-test';
     $this->client = $this->getServiceBuilder()->get('s3', true);
     //$this->client->addSubscriber(\Guzzle\Plugin\Log\LogPlugin::getDebugPlugin());
     //$this->client->addSubscriber(\Guzzle\Plugin\Log\LogPlugin::getDebugPlugin());
     $this->acp = AcpBuilder::newInstance()->setOwner(self::$ownerId, self::$displayName)->addGrantForGroup(Permission::READ, Group::AUTHENTICATED_USERS)->addGrantForGroup(Permission::READ_ACP, Group::ALL_USERS)->build();
 }
 public function testCanSetAcpOnMultipartUploadsAndEmitsDebug()
 {
     $client = $this->getServiceBuilder()->get('s3', true);
     $this->setMockResponse($client, array('s3/list_objects_empty', 's3/initiate_multipart_upload', 's3/upload_part', 's3/complete_multipart_upload'));
     $out = fopen('php://temp', 'r+');
     UploadSyncBuilder::getInstance()->setBucket('foo')->setClient($client)->setBaseDir(__DIR__)->enableDebugOutput($out)->setSourceIterator(new \ArrayIterator(array(new \SplFileInfo(__FILE__))))->setMultipartUploadSize(filesize(__FILE__) - 1)->setAcp(AcpBuilder::newInstance()->setOwner('123')->addGrantForEmail('READ_ACP', '*****@*****.**')->build())->build()->transfer();
     $requests = $this->getMockedRequests();
     $this->assertCount(4, $requests);
     $this->assertEquals('POST', $requests[1]->getMethod());
     $this->assertContains('?uploads', $requests[1]->getResource());
     $this->assertNotNull($requests[1]->getHeader('x-amz-grant-read-acp'));
     $this->assertEquals('PUT', $requests[2]->getMethod());
     $this->assertEquals('POST', $requests[3]->getMethod());
     $this->assertContains('uploadId=', $requests[3]->getResource());
     rewind($out);
     $contents = stream_get_contents($out);
     $this->assertContains('Beginning multipart upload: ' . __FILE__ . ' -> UploadSyncBuilderTest.php (', $contents);
     $this->assertContains('- Part 1 (', $contents);
 }
 protected function getAcp()
 {
     return AcpBuilder::newInstance()->setOwner('test')->addGrantForEmail('READ', '*****@*****.**')->addGrantForEmail('READ', '*****@*****.**')->addGrantForEmail('WRITE', '*****@*****.**')->addGrantForGroup('READ_ACP', Group::ALL_USERS)->build();
 }
 public function testCanBuildAnAcp()
 {
     $acl = AcpBuilder::newInstance()->setOwner('1234567890')->addGrantForEmail(Permission::READ, '*****@*****.**')->build();
     $this->assertInstanceOf('Aws\\S3\\Model\\Acp', $acl);
 }