public function BasicTest::testDoRefundPayment in Payment 8.2
@covers ::doRefundPayment
File
- tests/
src/ Unit/ Plugin/ Payment/ Method/ BasicTest.php, line 230
Class
- BasicTest
- @coversDefaultClass \Drupal\payment\Plugin\Payment\Method\Basic
Namespace
Drupal\Tests\payment\Unit\Plugin\Payment\MethodCode
public function testDoRefundPayment() {
$payment_status = $this
->createMock(PaymentStatusInterface::class);
$this->paymentStatusManager
->expects($this
->once())
->method('createInstance')
->with($this->pluginDefinition['refund_status_id'])
->willReturn($payment_status);
$payment = $this
->createMock(PaymentInterface::class);
$payment
->expects($this
->once())
->method('save');
$payment
->expects($this
->once())
->method('setPaymentStatus')
->with($payment_status);
$this->sut
->setPayment($payment);
$method = new \ReflectionMethod($this->sut, 'doRefundPayment');
$method
->setAccessible(TRUE);
$method
->invoke($this->sut, $payment);
}