Commit 2b7b8b35 authored by catch's avatar catch

Issue #2874878 by zengenuity, LoMo, alexpott: Status Report is not clear when...

Issue #2874878 by zengenuity, LoMo, alexpott: Status Report is not clear when cron job is not running or PHP memory limit too low
parent 62077099
......@@ -49,9 +49,7 @@ public static function preRenderGeneralInfo($element) {
}
}
}
$element['#general_info']['#' . $key] = $requirement;
unset($element['#requirements'][$key]);
break;
// Intentional fall-through.
case 'drupal':
case 'webserver':
......@@ -60,7 +58,9 @@ public static function preRenderGeneralInfo($element) {
case 'php':
case 'php_memory_limit':
$element['#general_info']['#' . $key] = $requirement;
unset($element['#requirements'][$key]);
if (isset($requirement['severity']) && $requirement['severity'] < REQUIREMENT_WARNING) {
unset($element['#requirements'][$key]);
}
break;
}
}
......
......@@ -5,6 +5,7 @@
use Drupal\Core\Url;
use Drupal\Tests\BrowserTestBase;
use Drupal\system\SystemRequirements;
use Symfony\Component\CssSelector\CssSelectorConverter;
/**
* Tests output on the status overview page.
......@@ -89,6 +90,15 @@ public function testStatusPage() {
$this->drupalGet('admin/reports/status/php');
$this->assertResponse(200, 'The phpinfo page is reachable.');
// Check if cron error is displayed in errors section
$cron_last_run = \Drupal::state()->get('system.cron_last');
\Drupal::state()->set('system.cron_last', 0);
$this->drupalGet('admin/reports/status');
$css_selector_converter = new CssSelectorConverter();
$xpath = $css_selector_converter->toXPath('details.system-status-report__entry') . '//div[contains(text(), "Cron has not run recently")]';
$this->assertNotEmpty($this->xpath($xpath), 'Cron has not run recently error is being displayed.');
\Drupal::state()->set('system.cron_last', $cron_last_run);
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment