@@ -413,15 +413,11 @@ public function test_core_target_course_gradetopass_calculate() {
413413 $ student1 = $ dg ->create_user ();
414414 $ student2 = $ dg ->create_user ();
415415 $ student3 = $ dg ->create_user ();
416- $ student4 = $ dg ->create_user ();
417416 $ studentrole = $ DB ->get_record ('role ' , array ('shortname ' => 'student ' ));
418417 $ dg ->enrol_user ($ student1 ->id , $ course1 ->id , $ studentrole ->id );
419418 $ dg ->enrol_user ($ student2 ->id , $ course1 ->id , $ studentrole ->id );
420419 $ dg ->enrol_user ($ student3 ->id , $ course1 ->id , $ studentrole ->id );
421420
422- $ enrolstart = mktime (0 , 0 , 0 , 10 , 25 , 2015 );
423- $ dg ->enrol_user ($ student4 ->id , $ course1 ->id , $ studentrole ->id , 'manual ' , $ enrolstart );
424-
425421 // get_all_samples() does not guarantee any order, so let's
426422 // explicitly define the expectations here for later comparing.
427423 // Expectations format being array($userid => expectation, ...)
@@ -439,9 +435,6 @@ public function test_core_target_course_gradetopass_calculate() {
439435 // Student 3 (has no grade) fails, so it's non achieved sample.
440436 $ expectations [$ student3 ->id ] = 1 ;
441437
442- // Student 4 should be null as its enrolment timestart is after the this range.
443- $ expectations [$ student4 ->id ] = null ;
444-
445438 $ courseitem ->gradepass = 50 ;
446439 $ DB ->update_record ('grade_items ' , $ courseitem );
447440
@@ -460,12 +453,9 @@ public function test_core_target_course_gradetopass_calculate() {
460453 $ method = $ class ->getMethod ('calculate_sample ' );
461454 $ method ->setAccessible (true );
462455
463- $ starttime = mktime (0 , 0 , 0 , 10 , 24 , 2015 );
464-
465456 // Verify all the expectations are fulfilled.
466457 foreach ($ sampleids as $ sampleid => $ key ) {
467- $ this ->assertEquals ($ expectations [$ samplesdata [$ key ]['user ' ]->id ], $ method ->invoke ($ target , $ sampleid ,
468- $ analysable , $ starttime ));
458+ $ this ->assertEquals ($ expectations [$ samplesdata [$ key ]['user ' ]->id ], $ method ->invoke ($ target , $ sampleid , $ analysable ));
469459 }
470460 }
471461}
0 commit comments