You are here

protected function BaseTest::assertExamplePageResults in Plug 7

Checks the example page content.

Parameters

array $results: Array containing the expected output.

$path: Path to the test page.

3 calls to BaseTest::assertExamplePageResults()
BaseTest::assertTestModulePlugins in modules/plug_example/lib/Drupal/plug_example/Tests/BaseTest.php
Checks the behavior when enabling/disabling plug_test module.
BasicTest::testBasicAnnotationExamplePage in modules/plug_example/lib/Drupal/plug_example/Tests/BasicTest.php
Tests annotated plugins example page output.
BasicTest::testBasicYamlExamplePage in modules/plug_example/lib/Drupal/plug_example/Tests/BasicTest.php
Tests YAML plugins example page output.

File

modules/plug_example/lib/Drupal/plug_example/Tests/BaseTest.php, line 98
Contains Drupal\plug_example\Tests\BaseTest.

Class

BaseTest

Namespace

Drupal\plug_example\Tests

Code

protected function assertExamplePageResults(array $results, $path) {
  $this
    ->drupalGet($path);

  // Check the page title.
  $this
    ->assertTitle('Plugins example | Drupal');

  // Check the number of plugins discovered is the expected.
  $this
    ->assertCountXpathItems('//*[@id="block-system-main"]//li', count($results));

  // Assert displayName() results for each plugin.
  foreach ($results as $result) {
    $this
      ->assertText($result);
  }
}