class FieldExampleMenuTest

Test the user-facing menus in Field Example.

@group field_example @group examples

Hierarchy

Expanded class hierarchy of FieldExampleMenuTest

Related topics

File

modules/field_example/tests/src/Functional/FieldExampleMenuTest.php, line 13

Namespace

Drupal\Tests\field_example\Functional
View source
class FieldExampleMenuTest extends FieldExampleBrowserTestBase {
  
  /**
   * Modules to enable.
   *
   * @var array
   */
  protected static $modules = [
    'field_example',
  ];
  
  /**
   * The installation profile to use with this test.
   *
   * This test class requires the "Tools" block.
   *
   * @var string
   */
  protected $profile = 'minimal';
  
  /**
   * Test for a link to the block example in the Tools menu.
   */
  public function testFieldExampleLink() {
    $assert = $this->assertSession();
    $this->drupalGet('');
    $assert->linkByHrefExists('examples/field-example');
  }
  
  /**
   * Tests field_example menus.
   */
  public function testBlockExampleMenu() {
    $assert = $this->assertSession();
    $this->drupalGet('examples/field-example');
    $assert->statusCodeEquals(200);
  }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
ExamplesBrowserTestBase::setupExamplesMenus protected function Set up menus and tasks in their regions.
FieldExampleBrowserTestBase::$administratorAccount protected property The administrator account.
FieldExampleBrowserTestBase::$authorAccount protected property The author account.
FieldExampleBrowserTestBase::$contentTypeName protected property The content type name.
FieldExampleBrowserTestBase::$defaultTheme protected property
FieldExampleBrowserTestBase::$fieldName protected property The field name.
FieldExampleBrowserTestBase::createField protected function Create a field on the content type created during setUp().
FieldExampleBrowserTestBase::setUp protected function Once installed, a content type with the desired field is created. Overrides ExamplesBrowserTestBase::setUp
FieldExampleMenuTest::$modules protected static property Modules to enable. Overrides FieldExampleBrowserTestBase::$modules
FieldExampleMenuTest::$profile protected property The installation profile to use with this test.
FieldExampleMenuTest::testBlockExampleMenu public function Tests field_example menus.
FieldExampleMenuTest::testFieldExampleLink public function Test for a link to the block example in the Tools menu.