You are here

public function PaymentMethodConfigurationFormTest::testPaymentMethodConfigurationIdExists in Payment 8.2

@covers ::paymentMethodConfigurationIdExists

File

tests/src/Unit/Entity/PaymentMethodConfiguration/PaymentMethodConfigurationFormTest.php, line 335

Class

PaymentMethodConfigurationFormTest
@coversDefaultClass \Drupal\payment\Entity\PaymentMethodConfiguration\PaymentMethodConfigurationForm

Namespace

Drupal\Tests\payment\Unit\Entity\PaymentMethodConfiguration

Code

public function testPaymentMethodConfigurationIdExists() {
  $payment_method_configuration_id = $this
    ->randomMachineName();
  $this->paymentMethodConfigurationStorage
    ->expects($this
    ->at(0))
    ->method('load')
    ->with($payment_method_configuration_id)
    ->willReturn($this->paymentMethodConfiguration);
  $this->paymentMethodConfigurationStorage
    ->expects($this
    ->at(1))
    ->method('load')
    ->with($payment_method_configuration_id)
    ->willReturn(NULL);
  $this
    ->assertTrue($this->sut
    ->paymentMethodConfigurationIdExists($payment_method_configuration_id));
  $this
    ->assertFalse($this->sut
    ->paymentMethodConfigurationIdExists($payment_method_configuration_id));
}