mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-53937 core_competency: False negative with duedate on plan reopen
This commit is contained in:
parent
f6ab2b87e6
commit
42c28b0874
@ -429,16 +429,17 @@ class core_competency_plan_testcase extends advanced_testcase {
|
||||
// Reopening plan: with due date in the future => duedate unchanged.
|
||||
$record = $plan->to_record();
|
||||
$record->status = plan::STATUS_COMPLETE;
|
||||
$record->duedate = time() + plan::DUEDATE_THRESHOLD + 10;
|
||||
$duedate = time() + plan::DUEDATE_THRESHOLD + 10;
|
||||
$record->duedate = $duedate;
|
||||
$DB->update_record(plan::TABLE, $record);
|
||||
|
||||
$success = core_competency\api::reopen_plan($plan->get_id());
|
||||
$this->assertTrue($success);
|
||||
$plan->read();
|
||||
|
||||
// Check that the due date has not changed, but allow for PHP Unit latency.
|
||||
$this->assertTrue($plan->get_duedate() >= time() + plan::DUEDATE_THRESHOLD + 10);
|
||||
$this->assertTrue($plan->get_duedate() <= time() + plan::DUEDATE_THRESHOLD + 15);
|
||||
// Check that the due date has not changed.
|
||||
$this->assertNotEquals(0, $plan->get_duedate());
|
||||
$this->assertEquals($duedate, $plan->get_duedate());
|
||||
}
|
||||
|
||||
public function test_get_by_user_and_competency() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user