You are here

public function IngredientAccessTest::assertIngredientCreateAccess in Recipe 8.2

Asserts that ingredient create access correctly grants or denies access.

Parameters

bool $result: Whether access should be granted or not.

\Drupal\Core\Session\AccountInterface $account: The user account for which to check access.

string|null $langcode: (optional) The language code indicating which translation of the ingredient to check. If NULL, the untranslated (fallback) access is checked.

1 call to IngredientAccessTest::assertIngredientCreateAccess()
IngredientAccessTest::testIngredientAccess in modules/ingredient/tests/src/Kernel/IngredientAccessTest.php
Test Ingredient access by permission.

File

modules/ingredient/tests/src/Kernel/IngredientAccessTest.php, line 127

Class

IngredientAccessTest
@coversDefaultClass \Drupal\ingredient\IngredientAccessControlHandler

Namespace

Drupal\Tests\ingredient\Kernel

Code

public function assertIngredientCreateAccess($result, AccountInterface $account, $langcode = NULL) {
  $this
    ->assertEquals($result, $this->accessHandler
    ->createAccess(NULL, $account, [
    'langcode' => $langcode,
  ]), $this
    ->accessAssertMessage('create', $result, $langcode));
}