/** * @param string $localeCode * @param float|null $orderTotal * @param string|null $pal * @param string|null $staticSize * @param string $areButtonDynamic * @param bool $sandboxFlag * @param string $result * @dataProvider dataProviderGetPaymentMarkImageUrl */ public function testGetPaymentMarkImageUrl($localeCode, $orderTotal, $pal, $staticSize, $areButtonDynamic, $sandboxFlag, $result) { $this->_model->setMethod(Config::METHOD_WPP_EXPRESS); $this->_model->setStoreId(123); $this->_scopeConfig->expects($this->any())->method('getValue')->willReturnMap([['paypal/wpp/button_flavor', ScopeInterface::SCOPE_STORE, 123, $areButtonDynamic], ['paypal/wpp/sandbox_flag', ScopeInterface::SCOPE_STORE, 123, $sandboxFlag]]); $this->assertEquals($result, $this->_model->getPaymentMarkImageUrl($localeCode, $orderTotal, $pal, $staticSize)); }
/** * Config instance setter * * @param \Magento\Paypal\Model\Config $instace * @param int|null $storeId * @return $this */ public function setConfig(\Magento\Paypal\Model\Config $instance, $storeId = null) { $this->_config = $instance; if (null !== $storeId) { $this->_config->setStoreId($storeId); } return $this; }
/** * @dataProvider dataProviderGetBmlDisplay */ public function testGetBmlDisplay($section, $expectedValue, $expectedFlag, $expected) { $this->_model->setStoreId(1); $this->_coreData->expects($this->any())->method('getDefaultCountry')->with(1)->will($this->returnValue('US')); $this->_scopeConfig->expects($this->any())->method('isSetFlag')->will($this->returnValue($expectedFlag)); $this->_scopeConfig->expects($this->any())->method('getValue')->will($this->returnValueMap([['payment/' . Config::METHOD_WPP_BML . '/' . $section . '_display', 'store', 1, $expectedValue], ['payment/' . Config::METHOD_WPP_BML . '/active', 'store', 1, $expectedValue], ['payment/' . Config::METHOD_WPP_PE_BML . '/active', 'store', 1, $expectedValue]])); $this->assertEquals($expected, $this->_model->getBmlDisplay($section)); }