You are here

public function EntityCrudTest::testInvoke in Payment 8.2

@covers ::invoke

File

tests/src/Unit/Hook/EntityCrudTest.php, line 60

Class

EntityCrudTest
@coversDefaultClass \Drupal\payment\Hook\EntityCrud

Namespace

Drupal\Tests\payment\Unit\Hook

Code

public function testInvoke() {
  $payment_method = $this
    ->createMock(PaymentMethodConfigurationInterface::class);
  $payment_method
    ->expects($this
    ->any())
    ->method('getEntityTypeId')
    ->willReturn('payment_method_configuration');
  $payment_status = $this
    ->createMock(PaymentStatusInterface::class);
  $payment_status
    ->expects($this
    ->any())
    ->method('getEntityTypeId')
    ->willReturn('payment_status');
  $this->paymentMethodManager
    ->expects($this
    ->once())
    ->method('clearCachedDefinitions');
  $this->paymentStatusManager
    ->expects($this
    ->once())
    ->method('clearCachedDefinitions');
  $this->sut
    ->invoke($payment_method);
  $this->sut
    ->invoke($payment_status);
}