public function testGetImages()
 {
     $cartId = 42;
     $itemId = 74;
     $itemData = ['product_image' => 'Magento.png', 'random' => '3.1415926535'];
     $itemMock = $this->getMock('Magento\\Quote\\Model\\Quote\\Item', [], [], '', false);
     $itemMock->expects($this->once())->method('getItemId')->willReturn($itemId);
     $expectedResult = [$itemId => $itemData['product_image']];
     $this->itemRepositoryMock->expects($this->once())->method('getList')->with($cartId)->willReturn([$itemMock]);
     $this->itemPoolMock->expects($this->once())->method('getItemData')->with($itemMock)->willReturn($itemData);
     $this->assertEquals($expectedResult, $this->model->getImages($cartId));
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function getConfig()
 {
     $quoteId = $this->checkoutSession->getQuote()->getId();
     $output['formKey'] = $this->formKey->getFormKey();
     $output['customerData'] = $this->getCustomerData();
     $output['quoteData'] = $this->getQuoteData();
     $output['quoteItemData'] = $this->getQuoteItemData();
     $output['isCustomerLoggedIn'] = $this->isCustomerLoggedIn();
     $output['selectedShippingMethod'] = $this->getSelectedShippingMethod();
     $output['storeCode'] = $this->getStoreCode();
     $output['isGuestCheckoutAllowed'] = $this->isGuestCheckoutAllowed();
     $output['isCustomerLoginRequired'] = $this->isCustomerLoginRequired();
     $output['registerUrl'] = $this->getRegisterUrl();
     $output['checkoutUrl'] = $this->getCheckoutUrl();
     $output['pageNotFoundUrl'] = $this->pageNotFoundUrl();
     $output['forgotPasswordUrl'] = $this->getForgotPasswordUrl();
     $output['staticBaseUrl'] = $this->getStaticBaseUrl();
     $output['priceFormat'] = $this->localeFormat->getPriceFormat(null, $this->checkoutSession->getQuote()->getQuoteCurrencyCode());
     $output['basePriceFormat'] = $this->localeFormat->getPriceFormat(null, $this->checkoutSession->getQuote()->getBaseCurrencyCode());
     $output['postCodes'] = $this->postCodesConfig->getPostCodes();
     $output['imageData'] = $this->imageProvider->getImages($quoteId);
     $output['defaultCountryId'] = $this->directoryHelper->getDefaultCountry();
     $output['totalsData'] = $this->getTotalsData();
     $output['shippingPolicy'] = ['isEnabled' => $this->scopeConfig->isSetFlag('shipping/shipping_policy/enable_shipping_policy', ScopeInterface::SCOPE_STORE), 'shippingPolicyContent' => nl2br($this->scopeConfig->getValue('shipping/shipping_policy/shipping_policy_content', ScopeInterface::SCOPE_STORE))];
     $output['activeCarriers'] = $this->getActiveCarriers();
     $output['originCountryCode'] = $this->getOriginCountryCode();
     $output['paymentMethods'] = $this->getPaymentMethods();
     $output['autocomplete'] = $this->isAutocompleteEnabled();
     return $output;
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public function getConfig()
 {
     $quoteId = $this->checkoutSession->getQuote()->getId();
     return ['formKey' => $this->formKey->getFormKey(), 'customerData' => $this->getCustomerData(), 'quoteData' => $this->getQuoteData(), 'quoteItemData' => $this->getQuoteItemData(), 'isCustomerLoggedIn' => $this->isCustomerLoggedIn(), 'selectedShippingMethod' => $this->getSelectedShippingMethod(), 'storeCode' => $this->getStoreCode(), 'isGuestCheckoutAllowed' => $this->isGuestCheckoutAllowed(), 'isCustomerLoginRequired' => $this->isCustomerLoginRequired(), 'registerUrl' => $this->getRegisterUrl(), 'customerAddressCount' => $this->getCustomerAddressCount(), 'forgotPasswordUrl' => $this->getForgotPasswordUrl(), 'staticBaseUrl' => $this->getStaticBaseUrl(), 'priceFormat' => $this->localeFormat->getPriceFormat(null, $this->checkoutSession->getQuote()->getQuoteCurrencyCode()), 'basePriceFormat' => $this->localeFormat->getPriceFormat(null, $this->currencyManager->getDefaultCurrency()), 'postCodes' => $this->postCodesConfig->getPostCodes(), 'imageData' => $this->imageProvider->getImages($quoteId), 'countryData' => $this->getCountryData(), 'totalsData' => $this->getTotalsData(), 'shippingRates' => $this->getDefaultShippingRates(), 'shippingPolicy' => ['isEnabled' => $this->scopeConfig->isSetFlag('shipping/shipping_policy/enable_shipping_policy', ScopeInterface::SCOPE_STORE), 'shippingPolicyContent' => nl2br($this->scopeConfig->getValue('shipping/shipping_policy/shipping_policy_content', ScopeInterface::SCOPE_STORE))], 'activeCarriers' => $this->getActiveCarriers(), 'originCountryCode' => $this->getOriginCountryCode(), 'paymentMethods' => $this->getPaymentMethods()];
 }