/** * @dataProvider resolveProvider */ public function testResolve($path, $filter, $requestUrl, $expected) { if ($requestUrl) { $this->requestContext->fromRequest(Request::create($requestUrl)); } $storageDir = '/var/doctorwho/storage/images'; $this->ioService->expects($this->once())->method('loadBinaryFile')->with($path)->will($this->returnValue(new BinaryFile(array('uri' => "{$storageDir}/{$path}")))); $result = $this->imageResolver->resolve($path, $filter); $this->assertSame($expected, $result); }
/** * @expectedException \Liip\ImagineBundle\Exception\Imagine\Cache\Resolver\NotResolvableException */ public function testResolveNotFound() { $path = 'foo/something.jpg'; $this->ioService->expects($this->once())->method('loadBinaryFile')->with($path)->will($this->throwException(new NotFoundException('foo', 'bar'))); $this->imageResolver->resolve($path, 'some_filter'); }