Inheritance: implements Liip\ImagineBundle\Imagine\Cache\Resolver\ResolverInterface
コード例 #1
0
 public function testRemoveWithFilters()
 {
     $originalPath = 'foo/bar/test.jpg';
     $filters = array('filter1', 'filter2', 'chaud_cacao');
     $this->configResolver->expects($this->never())->method('getParameter')->with('image_variations')->will($this->returnValue(array()));
     $fileToDelete = 'foo/bar/test_chaud_cacao.jpg';
     $this->ioService->expects($this->exactly(count($filters)))->method('exists')->will($this->returnValueMap(array(array('foo/bar/test_filter1.jpg', false), array('foo/bar/test_filter2.jpg', false), array($fileToDelete, true))));
     $binaryFile = new BinaryFile(array('id' => $fileToDelete));
     $this->ioService->expects($this->once())->method('loadBinaryFile')->with($fileToDelete)->will($this->returnValue($binaryFile));
     $this->ioService->expects($this->once())->method('deleteBinaryFile')->with($binaryFile);
     $this->imageResolver->remove(array($originalPath), $filters);
 }