| @@ 91-103 (lines=13) @@ | ||
| 88 | $resolver->store($binary, 'foobar.jpg', 'thumb'); |
|
| 89 | } |
|
| 90 | ||
| 91 | public function testIsStoredChecksObjectExistence() |
|
| 92 | { |
|
| 93 | $s3 = $this->createAmazonS3Mock(); |
|
| 94 | $s3 |
|
| 95 | ->expects($this->once()) |
|
| 96 | ->method('if_object_exists') |
|
| 97 | ->will($this->returnValue(false)) |
|
| 98 | ; |
|
| 99 | ||
| 100 | $resolver = new AmazonS3Resolver($s3, 'images.example.com'); |
|
| 101 | ||
| 102 | $this->assertFalse($resolver->isStored('/some-folder/path.jpg', 'thumb')); |
|
| 103 | } |
|
| 104 | ||
| 105 | public function testReturnResolvedImageUrlOnResolve() |
|
| 106 | { |
|
| @@ 114-126 (lines=13) @@ | ||
| 111 | $resolver->store($binary, 'images/foobar.jpg', 'filter'); |
|
| 112 | } |
|
| 113 | ||
| 114 | public function testIsStoredChecksObjectExistence() |
|
| 115 | { |
|
| 116 | $s3 = $this->getS3ClientMock(); |
|
| 117 | $s3 |
|
| 118 | ->expects($this->once()) |
|
| 119 | ->method('doesObjectExist') |
|
| 120 | ->will($this->returnValue(false)) |
|
| 121 | ; |
|
| 122 | ||
| 123 | $resolver = new AwsS3Resolver($s3, 'images.example.com'); |
|
| 124 | ||
| 125 | $this->assertFalse($resolver->isStored('/some-folder/path.jpg', 'thumb')); |
|
| 126 | } |
|
| 127 | ||
| 128 | public function testReturnResolvedImageUrlOnResolve() |
|
| 129 | { |
|