public function DomainAccessEntityFieldTest::testDomainAccessEntityFields in Domain Access 8
Tests that the fields are accessed properly.
File
- domain_access/
tests/ src/ Functional/ DomainAccessEntityFieldTest.php, line 44
Class
- DomainAccessEntityFieldTest
- Tests the domain access entity reference field type for custom entities.
Namespace
Drupal\Tests\domain_access\FunctionalCode
public function testDomainAccessEntityFields() {
$label = 'Send to all affiliates';
// Create a vocabulary.
$vocabulary = Vocabulary::create([
'name' => 'Domain vocabulary',
'description' => 'Test taxonomy for Domain Access',
'vid' => 'domain_access',
'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
'weight' => 100,
]);
$vocabulary
->save();
$text['taxonomy_term'] = [
'name' => 'term',
'label' => 'Send to all affiliates',
'description' => 'Make this term available on all domains.',
];
domain_access_confirm_fields('taxonomy_term', 'domain_access', $text);
$this->admin_user = $this
->drupalCreateUser([
'bypass node access',
'administer content types',
'administer node fields',
'administer node display',
'administer domains',
'publish to any domain',
'administer taxonomy',
'administer taxonomy_term fields',
'administer taxonomy_term form display',
]);
$this
->drupalLogin($this->admin_user);
$this
->drupalGet('admin/structure/taxonomy/manage/domain_access/overview/fields');
$this
->assertResponse(200, 'Manage fields page accessed.');
// Check for a domain field.
$this
->assertText('Domain Access', 'Domain form field found.');
}