3 namespace Drupal\Tests\field\Functional;
5 use Drupal\Tests\BrowserTestBase;
8 * Tests help display for the Field module.
12 class FieldHelpTest extends BrowserTestBase {
19 public static $modules = ['field', 'help'];
21 // Tests field help implementation without optional core modules enabled.
22 protected $profile = 'minimal';
25 * The admin user that will be created.
29 protected function setUp() {
32 // Create the admin user.
33 $this->adminUser = $this->drupalCreateUser(['access administration pages', 'view the administration theme']);
37 * Test the Field module's help page.
39 public function testFieldHelp() {
40 // Log in the admin user.
41 $this->drupalLogin($this->adminUser);
43 // Visit the Help page and make sure no warnings or notices are thrown.
44 $this->drupalGet('admin/help/field');
46 // Enable the Options, Email and Field API Test modules.
47 \Drupal::service('module_installer')->install(['options', 'field_test']);
49 \Drupal::service('plugin.manager.field.widget')->clearCachedDefinitions();
50 \Drupal::service('plugin.manager.field.field_type')->clearCachedDefinitions();
52 $this->drupalGet('admin/help/field');
53 $this->assertLink('Options', 0, 'Options module is listed on the Field help page.');
54 $this->assertText('Field API Test', 'Modules with field types that do not implement hook_help are listed.');
55 $this->assertNoLink('Field API Test', 'Modules with field types that do not implement hook_help are not linked.');
56 $this->assertNoLink('Link', 'Modules that have not been installed, are not listed.');