/** * @param \Gaufrette\Adapter $adapter * @param \AmazonS3 $service */ function it_updates_acl_with_users_array_when_write($adapter, $service) { $service->set_object_acl('bucketName', 'filename', array(array('id' => 'someId', 'permission' => \AmazonS3::GRANT_READ)))->shouldBeCalled()->willReturn(new \CFResponse(array(), '', 200)); $adapter->write('filename', 'some content')->willReturn(12); $this->setUsers(array(array('id' => 'someId', 'permission' => 'read'))); $this->write('filename', 'some content')->shouldReturn(12); }
/** * @param \AmazonS3 $service */ function its_file_metadata_acl_are_more_important_than_global_acl_config($service) { $this->setAcl('123abc'); $service->set_region(Argument::any())->shouldBeCalled(); $service->if_bucket_exists('bucketName')->shouldBeCalled()->willReturn(true); $service->create_object('bucketName', 'filename', array('acl' => 'more important acl', 'body' => 'some content'))->shouldBeCalled()->willReturn(new \CFResponse(array('x-aws-requestheaders' => array('Content-Length' => 12)), 'some content', 200)); $this->setMetadata('filename', array('acl' => 'more important acl')); $this->write('filename', 'some content')->shouldReturn(12); }
/** * @param \AmazonS3 $service */ function it_should_set_region_when_region_option_is_set($service) { $service->set_region(\AmazonS3::REGION_EU_W1)->shouldBeCalled(); $this->beConstructedWith($service, 'bucketName', array('region' => \AmazonS3::REGION_EU_W1)); $this->exists('filename'); }