class SecurityReportCase in Site Audit 8.2
Class SecurityReportCase.
@group commands
Hierarchy
- class \Unish\SiteAuditTestAbstract extends \Unish\CommandUnishTestCase
- class \Unish\SecurityReportCase
Expanded class hierarchy of SecurityReportCase
File
- tests/
securityReportTest.php, line 16 - Contains /site_audit/tests/SecurityReportCase.
Namespace
UnishView source
class SecurityReportCase extends SiteAuditTestAbstract {
/**
* Sets up the environment for this test.
*/
public function setUp() {
$this
->setUpSiteAuditTestEnvironment();
}
/**
* Check should pass on a default installation.
*/
public function testMenuRouterPass() {
$this
->drush('audit-security', array(), $this->options + array(
'detail' => NULL,
'json' => NULL,
));
$output = $this
->getOutput();
$output = json_decode($output);
$this
->assertEquals(\SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_PASS, $output->checks->SiteAuditCheckSecurityMenuRouter->score);
}
/**
* Enable a module with malicious menu router entry. Check should Fail.
*/
public function testMenuRouterFail() {
$dir = dirname(__DIR__) . '/tests/menu_router_test';
\symlink($dir, $this->options['root'] . '/modules/menu_router_test');
$this
->drush('pm-enable', array(
'menu_router_test',
), $this->options);
$this
->drush('audit-security', array(), $this->options + array(
'detail' => NULL,
'json' => NULL,
));
$output = $this
->getOutput();
$output = json_decode($output);
$this
->assertEquals(\SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_FAIL, $output->checks->SiteAuditCheckSecurityMenuRouter->score);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SecurityReportCase:: |
public | function | Sets up the environment for this test. | |
SecurityReportCase:: |
public | function | Enable a module with malicious menu router entry. Check should Fail. | |
SecurityReportCase:: |
public | function | Check should pass on a default installation. | |
SiteAuditTestAbstract:: |
public | function | Sets up environment for running site_audit tests. |