You are here

function PaymentStatusDeleteFormTest::testSubmitForm in Payment 8.2

@covers ::submitForm

File

tests/src/Unit/Entity/PaymentStatus/PaymentStatusDeleteFormTest.php, line 124

Class

PaymentStatusDeleteFormTest
@coversDefaultClass \Drupal\payment\Entity\PaymentStatus\PaymentStatusDeleteForm

Namespace

Drupal\Tests\payment\Unit\Entity\PaymentStatus

Code

function testSubmitForm() {
  $this->logger
    ->expects($this
    ->atLeastOnce())
    ->method('info');
  $url = new Url($this
    ->randomMachineName());
  $this->paymentStatus
    ->expects($this
    ->once())
    ->method('delete');
  $this->paymentStatus
    ->expects($this
    ->atLeastOnce())
    ->method('toUrl')
    ->with('collection')
    ->willReturn($url);
  $form = [];
  $form_state = $this
    ->createMock(FormStateInterface::class);
  $form_state
    ->expects($this
    ->once())
    ->method('setRedirectUrl')
    ->with($url);
  $this->sut
    ->submitForm($form, $form_state);
}