public function getViewFileUrlWithException()
 {
     $params = ['a' => 'b'];
     $paramsSecure = ['a' => 'b', '_secure' => false];
     $fileId = 'file id';
     $fileUrl = 'exception url';
     $this->requestMock->expects($this->once())->method('isSecure')->willReturn(false);
     $exception = new LocalizedException('message');
     $this->repositoryMock->expects($this->once())->method('getUrlWithParams')->with($fileId, $paramsSecure)->willThrowException($exception);
     $this->loggerMock->expects($this->once())->method('critical')->with($exception);
     $this->urlMock->expects($this->once())->method('getUrl')->with('', ['_direct' => 'core/index/notFound'])->willReturn($fileUrl);
     $this->assertEquals($fileUrl, $this->model->getViewFileUrl($fileId, $params));
 }
 /**
  * Get icons for available payment methods
  *
  * @return array
  */
 protected function getIcons()
 {
     $icons = [];
     $types = $this->ccConfig->getCcAvailableTypes();
     foreach (array_keys($types) as $code) {
         if (!array_key_exists($code, $icons)) {
             $asset = $this->ccConfig->createAsset('Magento_Payment::images/cc/' . strtolower($code) . '.png');
             $placeholder = $this->assetSource->findRelativeSourceFilePath($asset);
             if ($placeholder) {
                 list($width, $height) = getimagesize($asset->getSourceFile());
                 $icons[$code] = ['url' => $asset->getUrl(), 'width' => $width, 'height' => $height];
             }
         }
     }
     return $icons;
 }
 /**
  * Retrieve has verification configuration
  *
  * @param string $methodCode
  * @return bool
  */
 protected function hasVerification($methodCode)
 {
     $result = $this->ccConfig->hasVerification();
     $configData = $this->methods[$methodCode]->getConfigData('useccv');
     if ($configData !== null) {
         $result = (bool) $configData;
     }
     return $result;
 }
 /**
  * Retrieve the cvv image from ccconfig
  *
  * @return string
  */
 public function getCvvImageUrl()
 {
     return $this->ccConfig->getCvvImageUrl();
 }
 /**
  * Retrieve CVV tooltip image url
  *
  * @return string
  */
 protected function getCvvImageUrl()
 {
     return $this->ccConfig->getCvvImageUrl();
 }