class WatchdogReportCase in Site Audit 8.2
Class WatchdogReportCase.
@group commands
Hierarchy
- class \Unish\SiteAuditTestAbstract extends \Unish\CommandUnishTestCase
- class \Unish\WatchdogReportCase
Expanded class hierarchy of WatchdogReportCase
File
- tests/
watchdogReportTest.php, line 16 - Contains /site_audit/tests/WatchdogReportCase.
Namespace
UnishView source
class WatchdogReportCase extends SiteAuditTestAbstract {
/**
* Sets up the environment for this test.
*/
public function setUp() {
$this
->setUpSiteAuditTestEnvironment();
}
/**
* Block the user with uid 1. Check should Fail.
*/
public function test404Warn() {
$this
->drush('en', array(
'dblog',
), $this->options);
$eval1 = "\\Drupal::logger('page not found')->warning('drush tests');";
for ($i = 0; $i < 100; $i++) {
$this
->drush('php-eval', array(
$eval1,
), $this->options);
}
$this
->drush('audit-watchdog', array(), $this->options + array(
'detail' => NULL,
'json' => NULL,
));
$output = $this
->getOutput();
$output = json_decode($output);
$this
->assertEquals(\SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_WARN, $output->checks->SiteAuditCheckWatchdog404->score);
}
/**
* Create more than 10% php errors. Should Warn.
*/
public function testPhpWarn() {
$this
->drush('en', array(
'dblog',
), $this->options);
$eval1 = "\\Drupal::logger('php')->warning('drush tests');";
for ($i = 0; $i < 100; $i++) {
$this
->drush('php-eval', array(
$eval1,
), $this->options);
}
$this
->drush('audit-watchdog', array(), $this->options + array(
'detail' => NULL,
'json' => NULL,
));
$output = $this
->getOutput();
$output = json_decode($output);
$this
->assertEquals(\SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_WARN, $output->checks->SiteAuditCheckWatchdogPhp->score);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SiteAuditTestAbstract:: |
public | function | Sets up environment for running site_audit tests. | |
WatchdogReportCase:: |
public | function | Sets up the environment for this test. | |
WatchdogReportCase:: |
public | function | Block the user with uid 1. Check should Fail. | |
WatchdogReportCase:: |
public | function | Create more than 10% php errors. Should Warn. |