public function PaymentMethodConfigurationBaseTest::testBuildConfigurationFormWithFilter in Payment 8.2
@covers ::buildConfigurationForm
File
- tests/
src/ Unit/ Plugin/ Payment/ MethodConfiguration/ PaymentMethodConfigurationBaseTest.php, line 132
Class
- PaymentMethodConfigurationBaseTest
- @coversDefaultClass \Drupal\payment\Plugin\Payment\MethodConfiguration\PaymentMethodConfigurationBase
Namespace
Drupal\Tests\payment\Unit\Plugin\Payment\MethodConfigurationCode
public function testBuildConfigurationFormWithFilter() {
$form = [];
$form_state = $this
->createMock(FormStateInterface::class);
$this->moduleHandler
->expects($this
->once())
->method('moduleExists')
->with('filter')
->willReturn(TRUE);
$message_text = $this
->randomMachineName();
$message_format = $this
->randomMachineName();
$this->sut
->setMessageText($message_text);
$this->sut
->setMessageTextFormat($message_format);
$build = $this->sut
->buildConfigurationForm($form, $form_state);
$expected_build = array(
'message' => array(
'#tree' => TRUE,
'#type' => 'text_format',
'#title' => 'Payment form message',
'#default_value' => $message_text,
'#format' => $message_format,
),
);
$this
->assertEquals($expected_build, $build);
}