class FieldExampleMenuTest

Same name in other branches
  1. 3.x modules/field_example/tests/src/Functional/FieldExampleMenuTest.php \Drupal\Tests\field_example\Functional\FieldExampleMenuTest
  2. 4.0.x modules/field_example/tests/src/Functional/FieldExampleMenuTest.php \Drupal\Tests\field_example\Functional\FieldExampleMenuTest

Test the user-facing menus in Field Example.

@group field_example @group examples

Hierarchy

  • class \Drupal\Tests\examples\Functional\ExamplesBrowserTestBase extends \Drupal\Tests\BrowserTestBase
    • class \Drupal\Tests\field_example\Functional\FieldExampleBrowserTestBase extends \Drupal\Tests\examples\Functional\ExamplesBrowserTestBase
      • class \Drupal\Tests\field_example\Functional\FieldExampleMenuTest extends \Drupal\Tests\field_example\Functional\FieldExampleBrowserTestBase

Expanded class hierarchy of FieldExampleMenuTest

Related topics

File

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
     */
    public 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 public 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.