|
@@ 114-129 (lines=16) @@
|
| 111 |
|
$this->assertTrue($result); |
| 112 |
|
} |
| 113 |
|
|
| 114 |
|
public function testSendRequestInvalidTypePE() |
| 115 |
|
{ |
| 116 |
|
$address = $this->getMockBuilder(Address::class)->disableOriginalConstructor()->getMock(); |
| 117 |
|
$address->method('getCountryId')->willReturn('FR'); |
| 118 |
|
|
| 119 |
|
$this->shopHelper->expects($this->any()) |
| 120 |
|
->method('getConfigParam') |
| 121 |
|
->willReturnMap([ |
| 122 |
|
['enabled', 'address_check', 'payone_protect', null, true], |
| 123 |
|
['check_shipping', 'address_check', 'payone_protect', null, 'PE'] |
| 124 |
|
]); |
| 125 |
|
|
| 126 |
|
$result = $this->classToTest->sendRequest($address, false); |
| 127 |
|
$expected = ['wrongCountry' => true]; |
| 128 |
|
$this->assertEquals($expected, $result); |
| 129 |
|
} |
| 130 |
|
|
| 131 |
|
public function testSendRequestInvalidTypeBA() |
| 132 |
|
{ |
|
@@ 131-146 (lines=16) @@
|
| 128 |
|
$this->assertEquals($expected, $result); |
| 129 |
|
} |
| 130 |
|
|
| 131 |
|
public function testSendRequestInvalidTypeBA() |
| 132 |
|
{ |
| 133 |
|
$address = $this->getMockBuilder(Address::class)->disableOriginalConstructor()->getMock(); |
| 134 |
|
$address->method('getCountryId')->willReturn('XY'); |
| 135 |
|
|
| 136 |
|
$this->shopHelper->expects($this->any()) |
| 137 |
|
->method('getConfigParam') |
| 138 |
|
->willReturnMap([ |
| 139 |
|
['enabled', 'address_check', 'payone_protect', null, true], |
| 140 |
|
['check_shipping', 'address_check', 'payone_protect', null, 'BA'] |
| 141 |
|
]); |
| 142 |
|
|
| 143 |
|
$result = $this->classToTest->sendRequest($address, false); |
| 144 |
|
$expected = ['wrongCountry' => true]; |
| 145 |
|
$this->assertEquals($expected, $result); |
| 146 |
|
} |
| 147 |
|
|
| 148 |
|
public function testSendRequestNotChecked() |
| 149 |
|
{ |