@@ 177-204 (lines=28) @@ | ||
174 | $this->image->getMetaTags('some_tag', array('some_value', 'some_value_2', 'some_value_3')); |
|
175 | } |
|
176 | ||
177 | public function testGettingTagsWithVariationServiceThrowsInvalidVariationException() |
|
178 | { |
|
179 | $this->translationHelper->expects($this->once()) |
|
180 | ->method('getTranslatedField') |
|
181 | ->willReturn($this->field); |
|
182 | ||
183 | $this->fieldHelper->expects($this->once()) |
|
184 | ->method('isFieldEmpty') |
|
185 | ->willReturn(false); |
|
186 | ||
187 | $this->variationHandler->expects($this->once()) |
|
188 | ->method('getVariation') |
|
189 | ->willThrowException(new InvalidVariationException('name', 'type')); |
|
190 | ||
191 | $request = $this->getMockBuilder(Request::class) |
|
192 | ->disableOriginalConstructor() |
|
193 | ->setMethods(array()) |
|
194 | ->getMock(); |
|
195 | ||
196 | $this->requestStack->expects($this->once()) |
|
197 | ->method('getCurrentRequest') |
|
198 | ->willReturn($request); |
|
199 | ||
200 | $this->logger->expects($this->once()) |
|
201 | ->method('error'); |
|
202 | ||
203 | $this->image->getMetaTags('some_tag', array('some_value', 'some_value_2', 'some_value_3')); |
|
204 | } |
|
205 | ||
206 | public function testGettingTagsWithVariationServiceThrowsSourceImageNotFoundException() |
|
207 | { |
|
@@ 206-233 (lines=28) @@ | ||
203 | $this->image->getMetaTags('some_tag', array('some_value', 'some_value_2', 'some_value_3')); |
|
204 | } |
|
205 | ||
206 | public function testGettingTagsWithVariationServiceThrowsSourceImageNotFoundException() |
|
207 | { |
|
208 | $this->translationHelper->expects($this->once()) |
|
209 | ->method('getTranslatedField') |
|
210 | ->willReturn($this->field); |
|
211 | ||
212 | $this->fieldHelper->expects($this->once()) |
|
213 | ->method('isFieldEmpty') |
|
214 | ->willReturn(false); |
|
215 | ||
216 | $this->variationHandler->expects($this->once()) |
|
217 | ->method('getVariation') |
|
218 | ->willThrowException(new SourceImageNotFoundException('message')); |
|
219 | ||
220 | $request = $this->getMockBuilder(Request::class) |
|
221 | ->disableOriginalConstructor() |
|
222 | ->setMethods(array()) |
|
223 | ->getMock(); |
|
224 | ||
225 | $this->requestStack->expects($this->once()) |
|
226 | ->method('getCurrentRequest') |
|
227 | ->willReturn($request); |
|
228 | ||
229 | $this->logger->expects($this->once()) |
|
230 | ->method('error'); |
|
231 | ||
232 | $this->image->getMetaTags('some_tag', array('some_value', 'some_value_2', 'some_value_3')); |
|
233 | } |
|
234 | ||
235 | public function testGettingTagsWithMultipleArgumentsInArray() |
|
236 | { |