You are here

public function SetStatusTest::testValidateConfigurationForm in Payment 8.2

@covers ::validateConfigurationForm @covers ::getPluginSelector

@depends testBuildConfigurationForm

File

tests/src/Unit/Plugin/Action/SetStatusTest.php, line 151

Class

SetStatusTest
@coversDefaultClass \Drupal\payment\Plugin\Action\SetStatus

Namespace

Drupal\Tests\payment\Unit\Plugin\Action

Code

public function testValidateConfigurationForm() {
  $form = [
    'payment_status_plugin_id' => [
      '#foo' => $this
        ->randomMachineName(),
    ],
  ];
  $form_state = new FormState();
  $plugin_selector = $this
    ->createMock(PluginSelectorInterface::class);
  $plugin_selector
    ->expects($this
    ->once())
    ->method('validateSelectorForm')
    ->with($form['payment_status_plugin_id'], $form_state);
  $this->pluginSelectorManager
    ->expects($this
    ->atLeastOnce())
    ->method('createInstance')
    ->willReturn($plugin_selector);
  $this
    ->assertNull($this->sut
    ->validateConfigurationForm($form, $form_state));
}