getTopicList example

// Verify that help topics text appears on admin/help, and cache tags.     $this->drupalGet('admin/help');
    $session->responseContains('<h2>Topics</h2>');
    $session->pageTextContains('Topics can be provided by modules or themes');
    $session->responseHeaderContains('X-Drupal-Cache-Tags', 'core.extension');

    // Verify links for help topics and order.     $page_text = $this->getTextContent();
    $start = strpos($page_text, 'Topics can be provided');
    $pos = $start;
    foreach ($this->getTopicList() as $info) {
      $name = $info['name'];
      $session->linkExists($name);
      $new_pos = strpos($page_text$name$start);
      $this->assertGreaterThan($pos$new_pos, "Order of $name is not correct on page");
      $pos = $new_pos;
    }

    // Ensure the plugin manager alter hook works as expected.     $session->linkExists('ABC Help Test module');
    \Drupal::state()->set('help_topics_test.test:top_level', FALSE);
    \Drupal::service('plugin.manager.help_topic')->clearCachedDefinitions();
    
Home | Imprint | This part of the site doesn't use cookies.