You are here

protected function TaxonomySchemeUITest::setUp in Workbench Access 8

Overrides BrowserTestBase::setUp

File

tests/src/Functional/TaxonomySchemeUITest.php, line 57

Class

TaxonomySchemeUITest
Defines a class for testing the UI to create and configure schemes.

Namespace

Drupal\Tests\workbench_access\Functional

Code

protected function setUp() {
  parent::setUp();
  $this
    ->createContentType([
    'type' => 'page',
  ]);
  $this
    ->createContentType([
    'type' => 'article',
  ]);
  $this->vocabulary = $this
    ->setUpVocabulary();
  $this
    ->setUpTaxonomyFieldForEntityType('node', 'page', $this->vocabulary
    ->id());
  $this
    ->setUpTaxonomyFieldForEntityType('taxonomy_term', $this->vocabulary
    ->id(), $this->vocabulary
    ->id(), 'recursive', 'Recursive Field');
  $vocab = Vocabulary::create([
    'vid' => 'selected',
    'name' => 'Selected Vocabulary',
  ]);
  $vocab
    ->save();
  $this
    ->setUpTaxonomyFieldForEntityType('taxonomy_term', $vocab
    ->id(), $this->vocabulary
    ->id(), 'non_recursive', 'Allowed Field');
  entity_test_create_bundle('access_controlled');
  entity_test_create_bundle('notaccess_controlled');
  $this
    ->setUpTaxonomyFieldForEntityType('entity_test', 'access_controlled', $this->vocabulary
    ->id());
  $this->admin = $this
    ->setUpAdminUser([
    'administer workbench access',
  ]);
  $this
    ->placeBlock('local_actions_block');
}