12 public function testGetConfig()
14 $localeResolver = $this->createMock(\
Magento\Framework\Locale\ResolverInterface::class);
15 $localeResolver->expects($this->once())->method(
'getLocale');
19 $currentCustomer = $this->createMock(\
Magento\Customer\Helper\
Session\CurrentCustomer::class);
20 $currentCustomer->expects($this->atLeastOnce())->method(
'getCustomerId')->willReturn(12);
22 $paymentHelper= $this->createMock(\
Magento\
Payment\Helper\Data::class);
24 $paypalHelper = $this->createMock(\
Magento\Paypal\Helper\Data::class);
25 $paypalHelper->expects($this->atLeastOnce())->method(
'shouldAskToCreateBillingAgreement')->willReturn(
false);
28 $config->expects($this->once())->method(
'getPaymentMarkWhatIsPaypalUrl');
29 $config->expects($this->once())->method(
'getPaymentMarkImageUrl');
30 $config->expects($this->atLeastOnce())->method(
'setMethod');
34 $payment = $this->getMockBuilder(\
Magento\Paypal\Model\Payflowpro::class)
35 ->setMethods([
'isAvailable',
'getCheckoutRedirectUrl'])
36 ->setMockClassName(
'paymentInstance')
37 ->disableOriginalConstructor()
39 $payment->expects($this->atLeastOnce())->method(
'isAvailable')->willReturn(
true);
40 $payment->expects($this->atLeastOnce())->method(
'getCheckoutRedirectUrl')->willReturn(
'http://redirect.url');
41 $paymentHelper->expects($this->atLeastOnce())->method(
'getMethodInstance')->willReturn(
$payment);
44 $urlBuilderMock = $this->createMock(\
Magento\Framework\UrlInterface::class);
54 $configProvider->getConfig();