public function PaymentMethodBaseTest::testExecutePaymentAccessCurrency in Payment 8.2
@covers ::executePaymentAccessCurrency
@dataProvider providerTestExecutePaymentAccessCurrency
File
- tests/
src/ Unit/ Plugin/ Payment/ Method/ PaymentMethodBaseTest.php, line 401
Class
- PaymentMethodBaseTest
- @coversDefaultClass \Drupal\payment\Plugin\Payment\Method\PaymentMethodBase
Namespace
Drupal\Tests\payment\Unit\Plugin\Payment\MethodCode
public function testExecutePaymentAccessCurrency($expected, $supported_currencies, $payment_currency_code, $payment_amount) {
$payment = $this
->getMockPayment();
$payment
->expects($this
->atLeastOnce())
->method('getAmount')
->willReturn($payment_amount);
$payment
->expects($this
->atLeastOnce())
->method('getCurrencyCode')
->willReturn($payment_currency_code);
$this->sut
->setPayment($payment);
$this->sut
->expects($this
->atLeastOnce())
->method('getSupportedCurrencies')
->willReturn($supported_currencies);
$account = $this
->createMock(AccountInterface::class);
$method = new \ReflectionMethod($this->sut, 'executePaymentAccessCurrency');
$method
->setAccessible(TRUE);
$this
->assertSame($expected, $method
->invoke($this->sut, $account)
->isAllowed());
}