You are here

public function ManagerTest::testGetDefinitions in Field Permissions 8

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/Plugin/FieldPermissionType/ManagerTest.php \Drupal\Tests\field_permissions\Kernel\Plugin\FieldPermissionType\ManagerTest::testGetDefinitions()

Tests that plugin sorting is working.

@covers ::getDefinitions

File

tests/src/Kernel/Plugin/FieldPermissionType/ManagerTest.php, line 89

Class

ManagerTest
Integration tests for the field permission type plugin manager.

Namespace

Drupal\Tests\field_permissions\Kernel\Plugin\FieldPermissionType

Code

public function testGetDefinitions() {
  $definitions = $this->fieldPermissionTypeManager
    ->getDefinitions();

  // There should be 3 (one test plugin from the testing module).
  $this
    ->assertEquals(3, count($definitions));

  // The test plugin should be between the private and custom.
  $expected = [
    'private',
    'test_access',
    'custom',
  ];
  $this
    ->assertSame($expected, array_keys($definitions));
}