You are here

protected function TaxonomySchemeUITest::assertAdminCannotAddUnselectedVocabulary in Workbench Access 8

Assert admin cannot add a field that is not in the assigned vocabularies.

Parameters

\Drupal\workbench_access\Entity\AccessSchemeInterface $scheme: Access scheme.

1 call to TaxonomySchemeUITest::assertAdminCannotAddUnselectedVocabulary()
TaxonomySchemeUITest::testSchemeUi in tests/src/Functional/TaxonomySchemeUITest.php
Tests scheme UI.

File

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

Class

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

Namespace

Drupal\Tests\workbench_access\Functional

Code

protected function assertAdminCannotAddUnselectedVocabulary(AccessSchemeInterface $scheme) {
  $this
    ->drupalGet($scheme
    ->toUrl('edit-form'));
  $this
    ->submitForm([
    'scheme_settings[vocabularies][workbench_access]' => 0,
    'scheme_settings[vocabularies][selected]' => 1,
    'scheme_settings[fields][entity_test:access_controlled:field_workbench_access]' => 1,
    'scheme_settings[fields][node:page:field_workbench_access]' => 0,
  ], 'Save');
  $this
    ->assertSession()
    ->pageTextContains('The field Section on entity_test entities of type access_controlled is not in the selected vocabularies.');
  $this
    ->assertSession()
    ->pageTextNotContains('The field Section on node entities of type page is not in the selected vocabularies.');
}