コード例 #1
0
 /**
  * @expectedException \Exception
  * @expectedExceptionMessage Unable to write file into directory product/cache. Access forbidden.
  */
 public function testSaveWithException()
 {
     $exception = new FilesystemException();
     $this->writeMock->method('create')->will($this->throwException($exception));
     $this->loggerMock->expects($this->once())->method('critical')->with($exception);
     $this->imageMagic->save('product/cache', 'sample.jpg');
 }
コード例 #2
0
 /**
  * @expectedException \Exception
  * @expectedExceptionMessage Unable to write file into directory product/cache. Access forbidden.
  */
 public function testSaveWithException()
 {
     $exception = new FileSystemException(new \Magento\Framework\Phrase('Unable to write file into directory product/cache. Access forbidden.'));
     $this->writeMock->method('create')->will($this->throwException($exception));
     $this->loggerMock->expects($this->once())->method('critical')->with($exception);
     $this->imageMagic->save('product/cache', 'sample.jpg');
 }