public function PaymentFormTest::testActionsWithoutAvailablePlugins in Payment 8.2
@covers ::actions @covers ::getPaymentMethodManager
File
- modules/
payment_form/ tests/ src/ Unit/ Entity/ Payment/ PaymentFormTest.php, line 374
Class
- PaymentFormTest
- @coversDefaultClass \Drupal\payment_form\Entity\Payment\PaymentForm
Namespace
Drupal\Tests\payment_form\Unit\Entity\PaymentCode
public function testActionsWithoutAvailablePlugins() {
$form = [];
$form_state = new FormState();
$form_state
->set('plugin_selector', $this->pluginSelector);
$this->paymentMethodManager
->expects($this
->atLeastOnce())
->method('getDefinitions')
->willReturn([]);
$method = new \ReflectionMethod($this->sut, 'actions');
$method
->setAccessible(TRUE);
$actions = $method
->invokeArgs($this->sut, [
$form,
$form_state,
]);
$this
->assertTrue($actions['submit']['#disabled']);
}