function HelpTopicsUninstall::testHelpTopicsMerge

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

Tests upgrading help module for help topics.

See also

\help_update_10200()

\help_post_update_help_topics_search()

\help_post_update_help_topics_uninstall()

File

core/modules/help/tests/src/Functional/Update/HelpTopicsUninstall.php, line 39

Class

HelpTopicsUninstall
Tests merging help topics module when the module is enabled.

Namespace

Drupal\Tests\help\Functional\Update

Code

public function testHelpTopicsMerge() {
    $module_handler = \Drupal::moduleHandler();
    $this->assertTrue($module_handler->moduleExists('help'));
    $this->assertTrue($module_handler->moduleExists('help_topics'));
    $this->assertTrue($module_handler->moduleExists('search'));
    $this->assertFalse(\Drupal::database()->schema()
        ->tableExists('help_search_items'));
    $dependencies = $this->config('search.page.help_search')
        ->get('dependencies.module');
    $this->assertTrue(in_array('help_topics', $dependencies, TRUE));
    $this->assertFalse(in_array('help', $dependencies, TRUE));
    // Run updates.
    $this->runUpdates();
    $this->assertFalse(\Drupal::moduleHandler()->moduleExists('help_topics'));
    $this->assertTrue(\Drupal::database()->schema()
        ->tableExists('help_search_items'));
    $dependencies = $this->config('search.page.help_search')
        ->get('dependencies.module');
    $this->assertFalse(in_array('help_topics', $dependencies, TRUE));
    $this->assertTrue(in_array('help', $dependencies, TRUE));
}

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