protected function NodeAccessTest::setUp in Workbench Access 8
Overrides KernelTestBase::setUp
File
- tests/
src/ Kernel/ NodeAccessTest.php, line 71
Class
- NodeAccessTest
- Tests workbench_access integration with node access APIs.
Namespace
Drupal\Tests\workbench_access\KernelCode
protected function setUp() {
parent::setUp();
$this
->installEntitySchema('node');
$this
->installConfig([
'filter',
'node',
'workbench_access',
]);
$this
->installEntitySchema('user');
$this
->installEntitySchema('taxonomy_term');
$this
->installEntitySchema('section_association');
$this
->installSchema('system', [
'key_value',
'sequences',
]);
$node_type = $this
->createContentType([
'type' => 'page',
]);
$this
->createContentType([
'type' => 'article',
]);
$this->vocabulary = $this
->setUpVocabulary();
$this->accessHandler = $this->container
->get('entity_type.manager')
->getAccessControlHandler('node');
$this
->setUpTaxonomyFieldForEntityType('node', $node_type
->id(), $this->vocabulary
->id());
$this->scheme = $this
->setUpTaxonomyScheme($node_type, $this->vocabulary);
$this->userStorage = \Drupal::service('workbench_access.user_section_storage');
}