| @@ 75-89 (lines=15) @@ | ||
| 72 | $resolver->store($binary, 'foobar.jpg', 'thumb'); |
|
| 73 | } |
|
| 74 | ||
| 75 | public function testCreatedObjectOnAmazon() |
|
| 76 | { |
|
| 77 | $binary = new Binary('aContent', 'image/jpeg', 'jpeg'); |
|
| 78 | ||
| 79 | $s3 = $this->createAmazonS3Mock(); |
|
| 80 | $s3 |
|
| 81 | ->expects($this->once()) |
|
| 82 | ->method('create_object') |
|
| 83 | ->will($this->returnValue($this->createCFResponseMock(true))) |
|
| 84 | ; |
|
| 85 | ||
| 86 | $resolver = new AmazonS3Resolver($s3, 'images.example.com'); |
|
| 87 | ||
| 88 | $resolver->store($binary, 'foobar.jpg', 'thumb'); |
|
| 89 | } |
|
| 90 | ||
| 91 | public function testIsStoredChecksObjectExistence() |
|
| 92 | { |
|
| @@ 75-89 (lines=15) @@ | ||
| 72 | $resolver->store($binary, 'foobar.jpg', 'thumb'); |
|
| 73 | } |
|
| 74 | ||
| 75 | public function testCreateObjectOnAmazon() |
|
| 76 | { |
|
| 77 | $binary = new Binary('aContent', 'image/jpeg', 'jpeg'); |
|
| 78 | ||
| 79 | $s3 = $this->getS3ClientMock(); |
|
| 80 | $s3 |
|
| 81 | ->expects($this->once()) |
|
| 82 | ->method('putObject') |
|
| 83 | ->will($this->returnValue($this->getS3ResponseMock())) |
|
| 84 | ; |
|
| 85 | ||
| 86 | $resolver = new AwsS3Resolver($s3, 'images.example.com'); |
|
| 87 | ||
| 88 | $this->assertNull($resolver->store($binary, 'thumb/foobar.jpg', 'thumb')); |
|
| 89 | } |
|
| 90 | ||
| 91 | public function testObjectOptionsPassedToS3ClintOnCreate() |
|
| 92 | { |
|