class UsersReportCase in Site Audit 8.2
Class UsersReportCase.
@group commands
Hierarchy
- class \Unish\SiteAuditTestAbstract extends \Unish\CommandUnishTestCase
- class \Unish\UsersReportCase
Expanded class hierarchy of UsersReportCase
File
- tests/
usersReportTest.php, line 16 - Contains /site_audit/tests/UsersReportCase.
Namespace
UnishView source
class UsersReportCase 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 testBlockedNumberOneFail() {
$this
->drush('user-block', array(
1,
), $this->options);
$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->SiteAuditCheckUsersBlockedNumberOne->score);
}
/**
* UnBlock the user with uid 1. Check should Pass.
*/
public function testBlockedNumberOnePass() {
$this
->drush('user-unblock', array(
1,
), $this->options);
$this
->drush('audit-users', array(), $this->options + array(
'detail' => NULL,
'json' => NULL,
));
$output = json_decode($this
->getOutput());
$this
->assertEquals(\SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_PASS, $output->checks->SiteAuditCheckUsersBlockedNumberOne->score);
}
/**
* Delete user with uid 1. Check should Fail.
*/
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);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SiteAuditTestAbstract:: |
public | function | Sets up environment for running site_audit tests. | |
UsersReportCase:: |
public | function | Sets up the environment for this test. | |
UsersReportCase:: |
public | function | Block the user with uid 1. Check should Fail. | |
UsersReportCase:: |
public | function | UnBlock the user with uid 1. Check should Pass. | |
UsersReportCase:: |
public | function | Delete user with uid 1. Check should Fail. |