You are here

public function FieldHelpTest::testFieldHelp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/field/src/Tests/FieldHelpTest.php \Drupal\field\Tests\FieldHelpTest::testFieldHelp()

Test the Field module's help page.

File

core/modules/field/src/Tests/FieldHelpTest.php, line 44
Contains \Drupal\field\Tests\FieldHelpTest.

Class

FieldHelpTest
Tests help display for the Field module.

Namespace

Drupal\field\Tests

Code

public function testFieldHelp() {

  // Login the admin user.
  $this
    ->drupalLogin($this->adminUser);

  // Visit the Help page and make sure no warnings or notices are thrown.
  $this
    ->drupalGet('admin/help/field');

  // Enable the Options, Email and Field API Test modules.
  \Drupal::service('module_installer')
    ->install(array(
    'options',
    'field_test',
  ));
  $this
    ->resetAll();
  \Drupal::service('plugin.manager.field.widget')
    ->clearCachedDefinitions();
  \Drupal::service('plugin.manager.field.field_type')
    ->clearCachedDefinitions();
  $this
    ->drupalGet('admin/help/field');
  $this
    ->assertLink('Options', 0, 'Options module is listed on the Field help page.');
  $this
    ->assertText('Field API Test', 'Modules with field types that do not implement hook_help are listed.');
  $this
    ->assertNoLink('Field API Test', 'Modules with field types that do not implement hook_help are not linked.');
  $this
    ->assertNoLink('Link', 'Modules that have not been installed, are not listed.');
}