You are here

public function WorkbenchAccessTestTrait::setUpVocabulary in Workbench Access 8

Create a test vocabulary.

Return value

\Drupal\taxonomy\Entity\Vocabulary The vocabulary entity.

16 calls to WorkbenchAccessTestTrait::setUpVocabulary()
AccessByRoleFormTest::testAccessByRoleForm in tests/src/Functional/AccessByRoleFormTest.php
Tests that the correct roles are displayed on the access by role form.
AccessByUserFormTest::testAccessByUserForm in tests/src/Functional/AccessByUserFormTest.php
Tests that the correct users are displayed on the access by user form.
AccessCacheTest::testNodeEdit in tests/src/Functional/AccessCacheTest.php
Tests that the user can edit the node when allowed.
AddSchemeFormTest::setUp in tests/src/Functional/AddSchemeFormTest.php
AssignUserFormTest::testAssignUserForm in tests/src/Functional/AssignUserFormTest.php
Tests that the AssignUserForm works correctly.

... See full list

File

tests/src/Traits/WorkbenchAccessTestTrait.php, line 39

Class

WorkbenchAccessTestTrait
Contains helper classes for tests to set up various configuration.

Namespace

Drupal\Tests\workbench_access\Traits

Code

public function setUpVocabulary() {
  $vocab = Vocabulary::create([
    'vid' => 'workbench_access',
    'name' => 'Test Vocabulary',
  ]);
  $vocab
    ->save();
  return $vocab;
}