Chris@0: adminUser = $this->drupalCreateUser(['access administration pages', 'view the administration theme']); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Test the Field module's help page. Chris@0: */ Chris@0: public function testFieldHelp() { Chris@0: // Log in the admin user. Chris@0: $this->drupalLogin($this->adminUser); Chris@0: Chris@0: // Visit the Help page and make sure no warnings or notices are thrown. Chris@0: $this->drupalGet('admin/help/field'); Chris@0: Chris@0: // Enable the Options, Email and Field API Test modules. Chris@0: \Drupal::service('module_installer')->install(['options', 'field_test']); Chris@0: $this->resetAll(); Chris@0: \Drupal::service('plugin.manager.field.widget')->clearCachedDefinitions(); Chris@0: \Drupal::service('plugin.manager.field.field_type')->clearCachedDefinitions(); Chris@0: Chris@0: $this->drupalGet('admin/help/field'); Chris@0: $this->assertLink('Options', 0, 'Options module is listed on the Field help page.'); Chris@0: $this->assertText('Field API Test', 'Modules with field types that do not implement hook_help are listed.'); Chris@0: $this->assertNoLink('Field API Test', 'Modules with field types that do not implement hook_help are not linked.'); Chris@0: $this->assertNoLink('Link', 'Modules that have not been installed, are not listed.'); Chris@0: } Chris@0: Chris@0: }