You are here

public function DuplicatePaymentMethodConfigurationTest::testExecute in Payment 8.2

@covers ::execute

File

tests/src/Unit/Controller/DuplicatePaymentMethodConfigurationTest.php, line 72

Class

DuplicatePaymentMethodConfigurationTest
@coversDefaultClass \Drupal\payment\Controller\DuplicatePaymentMethodConfiguration

Namespace

Drupal\Tests\payment\Unit\Controller

Code

public function testExecute() {
  $payment_method_configuration = $this
    ->createMock(PaymentMethodConfigurationInterface::class);
  $payment_method_configuration
    ->expects($this
    ->once())
    ->method('createDuplicate')
    ->willReturnSelf();
  $payment_method_configuration
    ->expects($this
    ->once())
    ->method('setLabel')
    ->willReturnSelf();
  $form = $this
    ->createMock(EntityFormInterface::class);
  $this->entityFormBuilder
    ->expects($this
    ->once())
    ->method('getForm')
    ->with($payment_method_configuration, 'default')
    ->willReturn($form);
  $this->sut
    ->execute($payment_method_configuration);
}