function HelpTopicsMerge::testHelpTopicsMerge

Same name in other branches
  1. 10 core/modules/help/tests/src/Functional/Update/HelpTopicsMerge.php \Drupal\Tests\help\Functional\Update\HelpTopicsMerge::testHelpTopicsMerge()

Tests upgrading help module for help topics.

See also

\help_update_10200()

\help_post_update_help_topics_search()

\help_post_update_help_topics_disable()

File

core/modules/help/tests/src/Functional/Update/HelpTopicsMerge.php, line 40

Class

HelpTopicsMerge
Tests merging help topics module when the module is not installed.

Namespace

Drupal\Tests\help\Functional\Update

Code

public function testHelpTopicsMerge() {
    $moduleHandler = \Drupal::moduleHandler();
    $this->assertTrue($moduleHandler->moduleExists('help'));
    $this->assertFalse($moduleHandler->moduleExists('help_topics'));
    $this->assertTrue($moduleHandler->moduleExists('search'));
    $this->assertFalse(\Drupal::database()->schema()
        ->tableExists('help_search_items'));
    // No configuration present.
    $this->assertNull(SearchPage::load('help_search'));
    $this->assertNull(Block::load('claro_help_search'));
    // Run updates.
    $this->runUpdates();
    $this->assertFalse(\Drupal::moduleHandler()->moduleExists('help_topics'));
    $this->assertTrue(\Drupal::database()->schema()
        ->tableExists('help_search_items'));
    // Search module's configuration is installed.
    $this->assertNotNull(Block::load('claro_help_search'));
    $this->assertNotNull(SearchPage::load('help_search'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.