public function PaymentMethodConfigurationBaseTest::testSubmitConfigurationFormWithFilter in Payment 8.2
@covers ::submitConfigurationForm
File
- tests/
src/ Unit/ Plugin/ Payment/ MethodConfiguration/ PaymentMethodConfigurationBaseTest.php, line 209
Class
- PaymentMethodConfigurationBaseTest
- @coversDefaultClass \Drupal\payment\Plugin\Payment\MethodConfiguration\PaymentMethodConfigurationBase
Namespace
Drupal\Tests\payment\Unit\Plugin\Payment\MethodConfigurationCode
public function testSubmitConfigurationFormWithFilter() {
$message_text = $this
->randomMachineName();
$message_format = $this
->randomMachineName();
$this->moduleHandler
->expects($this
->once())
->method('moduleExists')
->with('filter')
->willReturn(TRUE);
$form = array(
'message' => array(
'#parents' => array(
'foo',
'bar',
'message',
),
),
);
$form_state = $this
->createMock(FormStateInterface::class);
$form_state
->expects($this
->atLeastOnce())
->method('getValues')
->willReturn(array(
'foo' => array(
'bar' => array(
'message' => array(
'value' => $message_text,
'format' => $message_format,
),
),
),
));
$this->sut
->submitConfigurationForm($form, $form_state);
$this
->assertSame($message_text, $this->sut
->getMessageText());
$this
->assertSame($message_format, $this->sut
->getMessageTextFormat());
}