You are here

public function SecurityReportCase::testMenuRouterFail in Site Audit 8.2

Enable a module with malicious menu router entry. Check should Fail.

File

tests/securityReportTest.php, line 40
Contains /site_audit/tests/SecurityReportCase.

Class

SecurityReportCase
Class SecurityReportCase.

Namespace

Unish

Code

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);
}