Commit 7254406f authored by willzyx's avatar willzyx

Issue #2834400 by willzyx: Add warning on Status report if devel is enabled

parent e21da6b2
......@@ -5,6 +5,25 @@
* Install, update and uninstall functions for the devel module.
*/
/**
* Implements hook_requirements().
*/
function devel_requirements($phase) {
$requirements = [];
if ($phase == 'runtime') {
// To understand the reasons why this message is marked as info see
// https://www.drupal.org/node/2834400.
$requirements['devel'] = [
'title' => t('Devel module enabled'),
'description' => t('The module provide the access to debug informations, therefore is recommended to disable the Devel module on production sites.'),
'severity' => REQUIREMENT_INFO,
];
}
return $requirements;
}
/**
* Set the default devel dumper plugin.
*/
......
<?php
namespace Drupal\Tests\devel\Functional;
use Drupal\Tests\BrowserTestBase;
/**
* Tests devel requirements.
*
* @group devel
*/
class DevelRequirementsTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['devel'];
/**
* Tests that the status page shows a warning when evel is enabled.
*/
public function testStatusPage() {
$admin_user = $this->drupalCreateUser(['administer site configuration']);
$this->drupalLogin($admin_user);
$this->drupalGet('admin/reports/status');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextContains('Devel module enabled');
$this->assertSession()->pageTextContains('The module provide the access to debug informations, therefore is recommended to disable the Devel module on production sites.');
}
}
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