View source
<?php
namespace Drupal\Tests\domain_access\Functional;
use Drupal\Core\Language\LanguageInterface;
use Drupal\taxonomy\Entity\Vocabulary;
use Drupal\Tests\domain\Functional\DomainTestBase;
class DomainAccessEntityFieldTest extends DomainTestBase {
public static $modules = [
'domain',
'domain_access',
'domain_access_test',
'field',
'field_ui',
'user',
'taxonomy',
];
protected function setUp() {
parent::setUp();
$this
->domainCreateTestDomains(5);
}
public function testDomainAccessEntityFields() {
$label = 'Send to all affiliates';
$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.');
$this
->assertText('Domain Access', 'Domain form field found.');
}
}