You are here

public function UsersReportCase::testWhoIsNumberOneFail in Site Audit 8.2

Delete user with uid 1. Check should Fail.

File

tests/usersReportTest.php, line 54
Contains /site_audit/tests/UsersReportCase.

Class

UsersReportCase
Class UsersReportCase.

Namespace

Unish

Code

public function testWhoIsNumberOneFail() {
  $this
    ->drush('user-cancel', array(
    1,
  ), $this->options);

  // Add a new user so that user count is not zero which will cause CountAll
  // test to abort this report.
  $this
    ->drush('user-create', array(
    'site_audit',
  ), $this->options + array(
    'mail' => 'person@example.com',
    'password' => 'site_audit',
  ));
  $this
    ->drush('audit-users', array(), $this->options + array(
    'detail' => NULL,
    'json' => NULL,
  ));
  $output = json_decode($this
    ->getOutput());
  $this
    ->assertEquals(\SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_FAIL, $output->checks->SiteAuditCheckUsersWhoIsNumberOne->score);
}