You are here

public function EntityBundleAccessCheckTest::getBundleAndAccessResult in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Entity/EntityBundleAccessCheckTest.php \Drupal\Tests\Core\Entity\EntityBundleAccessCheckTest::getBundleAndAccessResult()

Data provider.

File

core/tests/Drupal/Tests/Core/Entity/EntityBundleAccessCheckTest.php, line 39

Class

EntityBundleAccessCheckTest
Unit test of entity access checking system.

Namespace

Drupal\Tests\Core\Entity

Code

public function getBundleAndAccessResult() {
  return [
    [
      'article',
      'node:article',
      AccessResult::allowed(),
    ],
    [
      'page',
      'node:article',
      AccessResult::neutral('The entity bundle does not match the route _entity_bundles requirement.'),
    ],
    [
      'page',
      'node:article|page',
      AccessResult::allowed(),
    ],
    [
      'article',
      'node:article|page',
      AccessResult::allowed(),
    ],
    [
      'book_page',
      'node:article|page',
      AccessResult::neutral('The entity bundle does not match the route _entity_bundles requirement.'),
    ],
  ];
}