|
@@ 112-132 (lines=21) @@
|
| 109 |
|
$this->assertFalse($result); |
| 110 |
|
} |
| 111 |
|
|
| 112 |
|
public function testIsCreditratingNeededNotAgreedByCustomer() |
| 113 |
|
{ |
| 114 |
|
$this->consumerscoreHelper->method('isCreditratingNeeded')->willReturn(true); |
| 115 |
|
$this->consumerscoreHelper->method('getConfigParam')->willReturn(PayoneConfig::METHOD_CREDITCARD.','.PayoneConfig::METHOD_DEBIT); |
| 116 |
|
|
| 117 |
|
$infoInstance = $this->getMockBuilder(InfoInterface::class)->disableOriginalConstructor()->getMock(); |
| 118 |
|
$infoInstance->method('getAdditionalInformation')->willReturn(false); |
| 119 |
|
|
| 120 |
|
$paymentMethod = $this->getMockBuilder(MethodInterface::class)->disableOriginalConstructor()->getMock(); |
| 121 |
|
$paymentMethod->method('getCode')->willReturn(PayoneConfig::METHOD_CREDITCARD); |
| 122 |
|
$paymentMethod->method('getInfoInstance')->willReturn($infoInstance); |
| 123 |
|
|
| 124 |
|
$payment = $this->getMockBuilder(Payment::class)->disableOriginalConstructor()->getMock(); |
| 125 |
|
$payment->method('getMethodInstance')->willReturn($paymentMethod); |
| 126 |
|
|
| 127 |
|
$quote = $this->getMockBuilder(Quote::class)->disableOriginalConstructor()->getMock(); |
| 128 |
|
$quote->method('getPayment')->willReturn($payment); |
| 129 |
|
|
| 130 |
|
$result = $this->classToTest->isCreditratingNeeded($quote); |
| 131 |
|
$this->assertFalse($result); |
| 132 |
|
} |
| 133 |
|
|
| 134 |
|
public function testIsCreditratingNeeded() |
| 135 |
|
{ |
|
@@ 134-154 (lines=21) @@
|
| 131 |
|
$this->assertFalse($result); |
| 132 |
|
} |
| 133 |
|
|
| 134 |
|
public function testIsCreditratingNeeded() |
| 135 |
|
{ |
| 136 |
|
$this->consumerscoreHelper->method('isCreditratingNeeded')->willReturn(true); |
| 137 |
|
$this->consumerscoreHelper->method('getConfigParam')->willReturn(PayoneConfig::METHOD_CREDITCARD.','.PayoneConfig::METHOD_DEBIT); |
| 138 |
|
|
| 139 |
|
$infoInstance = $this->getMockBuilder(InfoInterface::class)->disableOriginalConstructor()->getMock(); |
| 140 |
|
$infoInstance->method('getAdditionalInformation')->willReturn(true); |
| 141 |
|
|
| 142 |
|
$paymentMethod = $this->getMockBuilder(MethodInterface::class)->disableOriginalConstructor()->getMock(); |
| 143 |
|
$paymentMethod->method('getCode')->willReturn(PayoneConfig::METHOD_CREDITCARD); |
| 144 |
|
$paymentMethod->method('getInfoInstance')->willReturn($infoInstance); |
| 145 |
|
|
| 146 |
|
$payment = $this->getMockBuilder(Payment::class)->disableOriginalConstructor()->getMock(); |
| 147 |
|
$payment->method('getMethodInstance')->willReturn($paymentMethod); |
| 148 |
|
|
| 149 |
|
$quote = $this->getMockBuilder(Quote::class)->disableOriginalConstructor()->getMock(); |
| 150 |
|
$quote->method('getPayment')->willReturn($payment); |
| 151 |
|
|
| 152 |
|
$result = $this->classToTest->isCreditratingNeeded($quote); |
| 153 |
|
$this->assertTrue($result); |
| 154 |
|
} |
| 155 |
|
|
| 156 |
|
public function testIsPaymentApplicableForScoreGreen() |
| 157 |
|
{ |