Exemplo n.º 1
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.º 2
0
 /**
  * @param \AmazonS3 $service
  */
 function it_should_not_mask_exception_when_write($service)
 {
     $service->if_bucket_exists('bucketName')->shouldBeCalled()->willReturn(true);
     $service->create_object(ANY_ARGUMENT, ANY_ARGUMENT, ANY_ARGUMENT)->willThrow(new \RuntimeException('write'));
     $this->shouldThrow(new \RuntimeException('write'))->duringWrite('filename', 'some content');
 }