|
@@ 329-346 (lines=18) @@
|
| 326 |
|
$this->assertFalse($result); |
| 327 |
|
} |
| 328 |
|
|
| 329 |
|
public function testIsCreditratingNeededSampleNotNeeded() |
| 330 |
|
{ |
| 331 |
|
$this->databaseHelper->method('getConfigParamWithoutCache')->willReturn(3); |
| 332 |
|
$this->scopeConfig->expects($this->any()) |
| 333 |
|
->method('getValue') |
| 334 |
|
->willReturnMap( |
| 335 |
|
[ |
| 336 |
|
['payone_protect/creditrating/enabled', ScopeInterface::SCOPE_STORE, null, 1], |
| 337 |
|
['payone_protect/creditrating/integration_event', ScopeInterface::SCOPE_STORE, null, 'before_payment'], |
| 338 |
|
['payone_protect/creditrating/min_order_total', ScopeInterface::SCOPE_STORE, null, 10], |
| 339 |
|
['payone_protect/creditrating/max_order_total', ScopeInterface::SCOPE_STORE, null, 1000], |
| 340 |
|
['payone_protect/creditrating/sample_mode_frequency', ScopeInterface::SCOPE_STORE, null, 5], |
| 341 |
|
['payone_protect/creditrating/sample_mode_enabled', ScopeInterface::SCOPE_STORE, null, 1] |
| 342 |
|
] |
| 343 |
|
); |
| 344 |
|
$result = $this->consumerscore->isCreditratingNeeded('before_payment', 500); |
| 345 |
|
$this->assertFalse($result); |
| 346 |
|
} |
| 347 |
|
|
| 348 |
|
public function testIsCreditratingNeeded() |
| 349 |
|
{ |
|
@@ 348-365 (lines=18) @@
|
| 345 |
|
$this->assertFalse($result); |
| 346 |
|
} |
| 347 |
|
|
| 348 |
|
public function testIsCreditratingNeeded() |
| 349 |
|
{ |
| 350 |
|
$this->databaseHelper->method('getConfigParamWithoutCache')->willReturn(5); |
| 351 |
|
$this->scopeConfig->expects($this->any()) |
| 352 |
|
->method('getValue') |
| 353 |
|
->willReturnMap( |
| 354 |
|
[ |
| 355 |
|
['payone_protect/creditrating/enabled', ScopeInterface::SCOPE_STORE, null, 1], |
| 356 |
|
['payone_protect/creditrating/integration_event', ScopeInterface::SCOPE_STORE, null, 'before_payment'], |
| 357 |
|
['payone_protect/creditrating/min_order_total', ScopeInterface::SCOPE_STORE, null, 10], |
| 358 |
|
['payone_protect/creditrating/max_order_total', ScopeInterface::SCOPE_STORE, null, 1000], |
| 359 |
|
['payone_protect/creditrating/sample_mode_frequency', ScopeInterface::SCOPE_STORE, null, 5], |
| 360 |
|
['payone_protect/creditrating/sample_mode_enabled', ScopeInterface::SCOPE_STORE, null, 1] |
| 361 |
|
] |
| 362 |
|
); |
| 363 |
|
$result = $this->consumerscore->isCreditratingNeeded('before_payment', 500); |
| 364 |
|
$this->assertTrue($result); |
| 365 |
|
} |
| 366 |
|
} |
| 367 |
|
|