| @@ 55-75 (lines=21) @@ | ||
| 52 | */ |
|
| 53 | private $scopeConfig; |
|
| 54 | ||
| 55 | protected function setUp() |
|
| 56 | { |
|
| 57 | $this->objectManager = new ObjectManager($this); |
|
| 58 | ||
| 59 | $remoteAddress = $this->getMockBuilder(RemoteAddress::class)->disableOriginalConstructor()->getMock(); |
|
| 60 | $remoteAddress->method('getRemoteAddress')->willReturn('192.168.1.100'); |
|
| 61 | ||
| 62 | $this->scopeConfig = $this->getMockBuilder(ScopeConfigInterface::class)->disableOriginalConstructor()->getMock(); |
|
| 63 | $context = $this->objectManager->getObject(Context::class, ['scopeConfig' => $this->scopeConfig, 'remoteAddress' => $remoteAddress]); |
|
| 64 | ||
| 65 | $store = $this->getMockBuilder(StoreInterface::class)->disableOriginalConstructor()->getMock(); |
|
| 66 | $store->method('getCode')->willReturn(null); |
|
| 67 | ||
| 68 | $storeManager = $this->getMockBuilder(StoreManagerInterface::class)->disableOriginalConstructor()->getMock(); |
|
| 69 | $storeManager->method('getStore')->willReturn($store); |
|
| 70 | ||
| 71 | $this->environment = $this->objectManager->getObject(Environment::class, [ |
|
| 72 | 'context' => $context, |
|
| 73 | 'storeManager' => $storeManager |
|
| 74 | ]); |
|
| 75 | } |
|
| 76 | ||
| 77 | public function testGetEncoding() |
|
| 78 | { |
|
| @@ 55-76 (lines=22) @@ | ||
| 52 | */ |
|
| 53 | private $scopeConfig; |
|
| 54 | ||
| 55 | protected function setUp() |
|
| 56 | { |
|
| 57 | $this->objectManager = new ObjectManager($this); |
|
| 58 | ||
| 59 | $this->scopeConfig = $this->getMockBuilder(ScopeConfigInterface::class)->disableOriginalConstructor()->getMock(); |
|
| 60 | $context = $this->objectManager->getObject(Context::class, ['scopeConfig' => $this->scopeConfig]); |
|
| 61 | ||
| 62 | $store = $this->getMockBuilder(StoreInterface::class)->disableOriginalConstructor()->getMock(); |
|
| 63 | $store->method('getCode')->willReturn(null); |
|
| 64 | ||
| 65 | $storeManager = $this->getMockBuilder(StoreManagerInterface::class)->disableOriginalConstructor()->getMock(); |
|
| 66 | $storeManager->method('getStore')->willReturn($store); |
|
| 67 | ||
| 68 | $paymentHelper = $this->getMockBuilder(Payment::class)->disableOriginalConstructor()->getMock(); |
|
| 69 | $paymentHelper->method('isCheckCvcActive')->willReturn(true); |
|
| 70 | ||
| 71 | $this->hostedIframe = $this->objectManager->getObject(HostedIframe::class, [ |
|
| 72 | 'context' => $context, |
|
| 73 | 'storeManager' => $storeManager, |
|
| 74 | 'paymentHelper' => $paymentHelper |
|
| 75 | ]); |
|
| 76 | } |
|
| 77 | ||
| 78 | public function testGetHostedFieldConfigEmpty() |
|
| 79 | { |
|