You are here

public function PaymentMethodConfigurationBaseTest::testSubmitConfigurationFormWithoutFilter in Payment 8.2

@covers ::submitConfigurationForm

File

tests/src/Unit/Plugin/Payment/MethodConfiguration/PaymentMethodConfigurationBaseTest.php, line 177

Class

PaymentMethodConfigurationBaseTest
@coversDefaultClass \Drupal\payment\Plugin\Payment\MethodConfiguration\PaymentMethodConfigurationBase

Namespace

Drupal\Tests\payment\Unit\Plugin\Payment\MethodConfiguration

Code

public function testSubmitConfigurationFormWithoutFilter() {
  $message_text = $this
    ->randomMachineName();
  $this->moduleHandler
    ->expects($this
    ->once())
    ->method('moduleExists')
    ->with('filter')
    ->willReturn(FALSE);
  $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' => $message_text,
      ),
    ),
  ));
  $this->sut
    ->submitConfigurationForm($form, $form_state);
  $this
    ->assertSame($message_text, $this->sut
    ->getMessageText());
}