@@ 196-213 (lines=18) @@ | ||
193 | $this->classToTest->handleAddressManagement($address, $this->quote, false); |
|
194 | } |
|
195 | ||
196 | public function testHandleAddressManagementExceptionInvalid() |
|
197 | { |
|
198 | $address = $this->getMockBuilder(Address::class) |
|
199 | ->disableOriginalConstructor() |
|
200 | ->setMethods(['getPayoneAddresscheckScore', 'setPayoneAddresscheckScore', 'getStreet', 'setStreet', 'getData', 'setData']) |
|
201 | ->getMock(); |
|
202 | $address->method('getPayoneAddresscheckScore')->willReturn(null); |
|
203 | ||
204 | $this->addresscheck->method('sendRequest')->willReturn(['status' => 'INVALID', 'customermessage' => 'Address invalid']); |
|
205 | $this->databaseHelper->expects($this->any()) |
|
206 | ->method('getConfigParam') |
|
207 | ->willReturnMap([ |
|
208 | ['message_response_invalid', 'address_check', 'payone_protect', null, null] |
|
209 | ]); |
|
210 | ||
211 | $this->expectException(LocalizedException::class); |
|
212 | $this->classToTest->handleAddressManagement($address, $this->quote, false); |
|
213 | } |
|
214 | ||
215 | public function testHandleAddressManagementExceptionNoStatus() |
|
216 | { |
|
@@ 234-251 (lines=18) @@ | ||
231 | $this->classToTest->handleAddressManagement($address, $this->quote, false); |
|
232 | } |
|
233 | ||
234 | public function testHandleAddressManagementExceptionInvalidDefault() |
|
235 | { |
|
236 | $address = $this->getMockBuilder(Address::class) |
|
237 | ->disableOriginalConstructor() |
|
238 | ->setMethods(['getPayoneAddresscheckScore', 'setPayoneAddresscheckScore', 'getStreet', 'setStreet', 'getData', 'setData']) |
|
239 | ->getMock(); |
|
240 | $address->method('getPayoneAddresscheckScore')->willReturn(null); |
|
241 | ||
242 | $this->addresscheck->method('sendRequest')->willReturn(['status' => 'INVALID', 'customermessage' => 'Address invalid']); |
|
243 | $this->databaseHelper->expects($this->any()) |
|
244 | ->method('getConfigParam') |
|
245 | ->willReturnMap([ |
|
246 | ['message_response_invalid', 'address_check', 'payone_protect', null, 'Address invalid: {{payone_customermessage}}'] |
|
247 | ]); |
|
248 | ||
249 | $this->expectException(LocalizedException::class); |
|
250 | $this->classToTest->handleAddressManagement($address, $this->quote, false); |
|
251 | } |
|
252 | ||
253 | public function testGetScoreR() |
|
254 | { |