Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
fmido88 authored Jun 30, 2023
1 parent e87e344 commit f88c759
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/enrol_wallet_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -1288,12 +1288,12 @@ public function test_get_unenrolself_link() {
$this->assertNotEmpty($wallet->get_unenrolself_link($instance));

$this->setAdminUser();
$wallet->update_user_enrol($instance, $user->id, ENROL_USER_ACTIVE, time() - 6 * HOURSECS, time() + 4 * DAYSECS);
$wallet->update_user_enrol($instance, $user->id, ENROL_USER_ACTIVE, time() - 6 * HOURSECS, time() + 4 * HOURSECS);
$this->setUser($user);
$this->assertEmpty($wallet->get_unenrolself_link($instance));

$this->setAdminUser();
$wallet->update_user_enrol($instance, $user->id, ENROL_USER_ACTIVE, time() - 9 * HOURSECS, time() + 1 * DAYSECS);
$wallet->update_user_enrol($instance, $user->id, ENROL_USER_ACTIVE, time() - 9 * HOURSECS, time() + 1 * HOURSECS);
$this->setUser($user);
$this->assertNotEmpty($wallet->get_unenrolself_link($instance));

Expand All @@ -1308,13 +1308,13 @@ public function test_get_unenrolself_link() {

// Cannot unenrol self after the condition after time.
$this->setAdminUser();
$wallet->update_user_enrol($instance, $user->id, ENROL_USER_ACTIVE, time() - 6 * HOURSECS, time() + 4 * DAYSECS);
$wallet->update_user_enrol($instance, $user->id, ENROL_USER_ACTIVE, time() - 6 * HOURSECS, time() + 4 * HOURSECS);
$this->setUser($user);
$this->assertEmpty($wallet->get_unenrolself_link($instance));

// Cannot self unenrol.
$this->setAdminUser();
$wallet->update_user_enrol($instance, $user->id, ENROL_USER_ACTIVE, time() - 9 * HOURSECS, time() + 1 * DAYSECS);
$wallet->update_user_enrol($instance, $user->id, ENROL_USER_ACTIVE, time() - 9 * HOURSECS, time() + 1 * HOURSECS);
$this->setUser($user);
$this->assertEmpty($wallet->get_unenrolself_link($instance));

Expand All @@ -1329,13 +1329,13 @@ public function test_get_unenrolself_link() {

// Cannot unenrol.
$this->setAdminUser();
$wallet->update_user_enrol($instance, $user->id, ENROL_USER_ACTIVE, time() - 6 * HOURSECS, time() + 4 * DAYSECS);
$wallet->update_user_enrol($instance, $user->id, ENROL_USER_ACTIVE, time() - 6 * HOURSECS, time() + 4 * HOURSECS);
$this->setUser($user);
$this->assertEmpty($wallet->get_unenrolself_link($instance));

// Can self unenrol.
$this->setAdminUser();
$wallet->update_user_enrol($instance, $user->id, ENROL_USER_ACTIVE, time() - 9 * HOURSECS, time() + 1 * DAYSECS);
$wallet->update_user_enrol($instance, $user->id, ENROL_USER_ACTIVE, time() - 9 * HOURSECS, time() + 1 * HOURSECS);
$this->setUser($user);
$this->assertNotEmpty($wallet->get_unenrolself_link($instance));
}
Expand Down

0 comments on commit f88c759

Please sign in to comment.