You are here

protected function PaymentMethodConfigurationAccessControlHandlerTest::getMockPaymentMethodConfiguration in Payment 8.2

Gets a mock payment method configuration.

Return value

\Drupal\payment\Entity\PaymentMethodConfiguration|\PHPUnit\Framework\MockObject\MockObject

6 calls to PaymentMethodConfigurationAccessControlHandlerTest::getMockPaymentMethodConfiguration()
PaymentMethodConfigurationAccessControlHandlerTest::testCheckAccessDisable in tests/src/Unit/Entity/PaymentMethodConfiguration/PaymentMethodConfigurationAccessControlHandlerTest.php
@covers ::checkAccess
PaymentMethodConfigurationAccessControlHandlerTest::testCheckAccessDuplicate in tests/src/Unit/Entity/PaymentMethodConfiguration/PaymentMethodConfigurationAccessControlHandlerTest.php
@covers ::checkAccess
PaymentMethodConfigurationAccessControlHandlerTest::testCheckAccessEnable in tests/src/Unit/Entity/PaymentMethodConfiguration/PaymentMethodConfigurationAccessControlHandlerTest.php
@covers ::checkAccess
PaymentMethodConfigurationAccessControlHandlerTest::testCheckAccessWithAnyPermission in tests/src/Unit/Entity/PaymentMethodConfiguration/PaymentMethodConfigurationAccessControlHandlerTest.php
@covers ::checkAccess
PaymentMethodConfigurationAccessControlHandlerTest::testCheckAccessWithoutPermission in tests/src/Unit/Entity/PaymentMethodConfiguration/PaymentMethodConfigurationAccessControlHandlerTest.php
@covers ::checkAccess

... See full list

File

tests/src/Unit/Entity/PaymentMethodConfiguration/PaymentMethodConfigurationAccessControlHandlerTest.php, line 87

Class

PaymentMethodConfigurationAccessControlHandlerTest
@coversDefaultClass \Drupal\payment\Entity\PaymentMethodConfiguration\PaymentMethodConfigurationAccessControlHandler

Namespace

Drupal\Tests\payment\Unit\Entity\PaymentMethodConfiguration

Code

protected function getMockPaymentMethodConfiguration() {
  $payment_method_configuration = $this
    ->createMock(PaymentMethodConfigurationInterface::class);
  $payment_method_configuration
    ->expects($this
    ->any())
    ->method('getCacheContexts')
    ->willReturn([]);
  $payment_method_configuration
    ->expects($this
    ->any())
    ->method('getCacheTags')
    ->willReturn([
    'payment_method_configuration',
  ]);
  return $payment_method_configuration;
}