-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
22 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,6 @@ | |
* Testcase for availability_user | ||
*/ | ||
class availability_user_condition_testcase extends advanced_testcase { | ||
|
||
/** | ||
* Load necessary libs | ||
*/ | ||
|
@@ -47,34 +46,34 @@ public function setUp(): void { | |
$this->capabilitychecker = new \core_availability\capability_checker($this->info->get_context()); | ||
$this->resetAfterTest(); | ||
$this->user1 = $this->getDataGenerator()->create_user( | ||
array( | ||
[ | ||
'email' => '[email protected]', | ||
'username' => 'user1') | ||
'username' => 'user1', ] | ||
); | ||
$this->user2 = $this->getDataGenerator()->create_user( | ||
array( | ||
[ | ||
'email' => '[email protected]', | ||
'username' => 'user2') | ||
'username' => 'user2', ] | ||
); | ||
$this->user3 = $this->getDataGenerator()->create_user( | ||
array( | ||
[ | ||
'email' => '[email protected]', | ||
'username' => 'user3') | ||
'username' => 'user3', ] | ||
); | ||
$this->user4 = $this->getDataGenerator()->create_user( | ||
array( | ||
[ | ||
'email' => '[email protected]', | ||
'username' => 'user4') | ||
'username' => 'user4', ] | ||
); | ||
$oldstructure = new stdClass; | ||
$oldstructure = new stdClass(); | ||
$oldstructure->userid = $this->user1->id; | ||
$this->cond = new condition($oldstructure); | ||
|
||
$newstructure = new stdClass; | ||
$newstructure = new stdClass(); | ||
$newstructure->userids = [$this->user1->id]; | ||
$this->newcond = new condition($newstructure); | ||
|
||
$multiplestructure = new stdClass; | ||
$multiplestructure = new stdClass(); | ||
$multiplestructure->userids = [$this->user1->id, $this->user2->id, $this->user3->id]; | ||
$this->multiplecond = new condition($multiplestructure); | ||
} | ||
|
@@ -243,7 +242,7 @@ public function test_users_multiple_filter() { | |
$this->user1->id => $this->user1, | ||
$this->user2->id => $this->user2, | ||
$this->user3->id => $this->user3, | ||
$this->user4->id => $this->user4 | ||
$this->user4->id => $this->user4, | ||
]; | ||
$filteredlist = $this->multiplecond->filter_user_list($users, false, $this->info, $this->capabilitychecker); | ||
$filtereduserids = array_keys($filteredlist); | ||
|
@@ -263,7 +262,7 @@ public function test_users_multiple_filter_not() { | |
$this->user1->id => $this->user1, | ||
$this->user2->id => $this->user2, | ||
$this->user3->id => $this->user3, | ||
$this->user4->id => $this->user4 | ||
$this->user4->id => $this->user4, | ||
]; | ||
$filteredlist = $this->multiplecond->filter_user_list($users, true, $this->info, $this->capabilitychecker); | ||
$filtereduserids = array_keys($filteredlist); | ||
|