public function BasicTest::testDoCapturePayment in Payment 8.2
@covers ::doCapturePayment
File
- tests/
src/ Unit/ Plugin/ Payment/ Method/ BasicTest.php, line 154
Class
- BasicTest
- @coversDefaultClass \Drupal\payment\Plugin\Payment\Method\Basic
Namespace
Drupal\Tests\payment\Unit\Plugin\Payment\MethodCode
public function testDoCapturePayment() {
$payment_status = $this
->createMock(PaymentStatusInterface::class);
$this->paymentStatusManager
->expects($this
->once())
->method('createInstance')
->with($this->pluginDefinition['capture_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, 'doCapturePayment');
$method
->setAccessible(TRUE);
$method
->invoke($this->sut, $payment);
}