You are here

public function PluginTypeExampleTest::testPluginExamplePage in Examples for Developers 8

Same name and namespace in other branches
  1. 3.x modules/plugin_type_example/tests/src/Functional/PluginTypeExampleTest.php \Drupal\Tests\plugin_type_example\Functional\PluginTypeExampleTest::testPluginExamplePage()

Test the output of the example page.

File

plugin_type_example/tests/src/Functional/PluginTypeExampleTest.php, line 74

Class

PluginTypeExampleTest
Test the functionality of the Plugin Type Example module.

Namespace

Drupal\Tests\plugin_type_example\Functional

Code

public function testPluginExamplePage() {
  $assert = $this
    ->assertSession();
  $this
    ->drupalGet('examples/plugin-type-example');
  $assert
    ->statusCodeEquals(200);

  // Check we see the plugin id.
  $assert
    ->pageTextContains('ham_sandwich', 'The plugin ID was not output.');

  // Check we see the plugin description.
  $assert
    ->pageTextContains('Ham, mustard, rocket, sun-dried tomatoes.', 'The plugin description was not output.');
}