You are here

public function PaymentAccessTest::testCreateAccess in Commerce Core 8.2

@covers ::checkCreateAccess

File

modules/payment/tests/src/Kernel/PaymentAccessTest.php, line 147

Class

PaymentAccessTest
Tests the payment access control.

Namespace

Drupal\Tests\commerce_payment\Kernel

Code

public function testCreateAccess() {
  $access_control_handler = \Drupal::entityTypeManager()
    ->getAccessControlHandler('commerce_payment');
  $account = $this
    ->createUser([], [
    'access content',
  ]);
  $this
    ->assertFalse($access_control_handler
    ->createAccess('payment_default', $account));
  $account = $this
    ->createUser([], [
    'administer commerce_payment',
  ]);
  $this
    ->assertTrue($access_control_handler
    ->createAccess('payment_default', $account));
}