/** * Tests that the function returns true when the number of previous courses is higher than the minumimum defined, * i.e., the input is ABOVE the lower limit of the input domain. In this case, since the input domain only has a limit, * the lower one, the input is also INSIDE. */ public function test_meets_minimum_previous_courses_above() { $this->resetAfterTest(); $this->setAdminUser(); // The course will meet the minimum previous courses, so, we expect a true from the function. $expected = true; // We stablish a value that is inside the input domain. $numberofcoursestocreate = course_filter::MINIMUM_PREVIOUS_COURSES + 1; // We create those courses, with the attributes defined in setUp. $previouscourses = $this->create_courses($this->previouscourseattributes, $numberofcoursestocreate); $this->insert_previous_courses_in_historic_data($previouscourses); // We get the actual value and we do the assertion. $currentcourseid = $this->currentcourse[0]->id; $actual = course_filter::meets_minimum_previous_courses($currentcourseid, $this->currentyear, $this->db); $this->assertEquals($expected, $actual); }