1 system.test public DebugReportTestCase::testDebugReportPage()

Tests the "admin/reports/debug" page.

File

core/modules/system/tests/system.test, line 2544
Tests for system.module.

Class

DebugReportTestCase
Tests administrative overview pages.

Code

public function testDebugReportPage() {
  $this->backdropGet('admin/reports/debug');
  $this->assertResponse(200);
  $element = $this->xpath('//textarea[@id="debug-info-wrapper"]');
  $debug_contents = (string) $element[0];

  $tab_size = 29;

  // Check core version.
  $core_string = str_pad('Backdrop CMS:', $tab_size) . BACKDROP_VERSION;
  $this->assertTrue(strpos($debug_contents, $core_string) === 0, 'Backdrop core version found in debug report.');

  // Install profile.
  $core_string = str_pad('Installation profile:', $tab_size) . 'testing';
  $this->assertTrue(strpos($debug_contents, $core_string), 'Install profile found in debug report.');

  // Check current theme.
  $theme_string = str_pad('Default theme:', $tab_size) . 'Stark';
  $this->assertTrue(strpos($debug_contents, $theme_string), 'Current theme found in debug report.');

  // Check an enabled module.
  $theme_string = str_pad('node', $tab_size) . BACKDROP_VERSION;
  $this->assertTrue(strpos($debug_contents, $theme_string), 'Enabled module "node" found.');
}