/** * @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_fail_when_cannot_create_bucket($service) { $service->if_bucket_exists('bucketName')->willReturn(false); $service->create_bucket('bucketName', \AmazonS3::REGION_US_E1)->shouldBeCalled()->willReturn(new \CFResponse(array(), 'created', 500)); $this->beConstructedWith($service, 'bucketName', array('create' => true)); $this->shouldThrow(new \RuntimeException('Failed to create the configured bucket "bucketName".'))->duringExists('filename'); }