Exemplo n.º 1
0
 /**
  * @param \AmazonS3 $service
  */
 function it_allows_to_configure_region_for_bucket($service)
 {
     $service->set_region(Argument::any())->shouldBeCalled();
     $service->if_bucket_exists('bucketName')->willReturn(false);
     $service->create_bucket('bucketName', \AmazonS3::REGION_EU_W1)->shouldBeCalled()->willReturn(new \CFResponse(array(), 'created', 201));
     $service->if_object_exists('bucketName', 'filename')->willReturn(false);
     $this->beConstructedWith($service, 'bucketName', array('create' => true, 'region' => \AmazonS3::REGION_EU_W1));
     $this->exists('filename');
 }
Exemplo n.º 2
0
 /**
  * @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);
 }
Exemplo n.º 3
0
 /**
  * @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');
 }