diff --git a/tests/main/gradebook/lib/be/attendancelink.class.test.php b/tests/main/gradebook/lib/be/attendancelink.class.test.php index d4bc359d33..d4ad9b345b 100644 --- a/tests/main/gradebook/lib/be/attendancelink.class.test.php +++ b/tests/main/gradebook/lib/be/attendancelink.class.test.php @@ -1,7 +1,4 @@ attendance = new AttendanceLink(); - $this->attendance->set_course_code('COURSETEST'); + $this->attendance->set_course_code('COURSEATTENDANCELINK'); $this->attendance->set_id (1); $this->attendance->set_type (LINK_ATTENDANCE); $this->attendance->set_ref_id (1) ; @@ -23,7 +20,7 @@ class TestAttendanceLink extends UnitTestCase { $this->attendance->set_date ($date); $this->attendance->set_weight (1); $this->attendance->set_visible (1); - $this->attendance->set_session_id(1); + $this->attendance->set_session_id(1); } public function testcalc_score() { @@ -131,7 +128,7 @@ class TestAttendanceLink extends UnitTestCase { public function __destruct() { // The destructor acts like a global tearDown for the class - require_once api_get_path(SYS_TEST_PATH).'teardown.inc.php'; + TestManager::delete_test_course('COURSEATTENDANCELINK'); } } ?> diff --git a/tests/main/gradebook/lib/be/category.class.test.php b/tests/main/gradebook/lib/be/category.class.test.php index e19dea9b39..d59f2cff97 100644 --- a/tests/main/gradebook/lib/be/category.class.test.php +++ b/tests/main/gradebook/lib/be/category.class.test.php @@ -1,5 +1,4 @@ category = new Category(); $this->category->set_id(1); $this->category->set_name('test'); $this->category->set_description('test description'); $this->category->set_user_id(1); - $this->category->set_course_code('COURSETEST'); + $this->category->set_course_code('COURSECATEGORYCLASS'); $this->category->set_certificate_min_score(20); $this->category->set_parent_id(1); $this->category->set_session_id(1); @@ -412,7 +411,7 @@ class TestCategoryClass extends UnitTestCase { public function __destruct() { // The destructor acts like a global tearDown for the class - require_once api_get_path(SYS_TEST_PATH).'teardown.inc.php'; + TestManager::delete_test_course('COURSECATEGORYCLASS'); } } ?> diff --git a/tests/main/gradebook/lib/be/dropboxlink.class.test.php b/tests/main/gradebook/lib/be/dropboxlink.class.test.php index 280b406803..8906160f8a 100644 --- a/tests/main/gradebook/lib/be/dropboxlink.class.test.php +++ b/tests/main/gradebook/lib/be/dropboxlink.class.test.php @@ -1,8 +1,4 @@ dropbox = new DropboxLink(); + $this->dropbox->set_course_code('COURSEDROPBOXLINK'); + $this->dropbox->set_name('test'); } public function testget_type_name() { @@ -25,7 +23,7 @@ class TestDropBoxLink extends UnitTestCase { public function testget_view_url() { $stud_id = 1; $res = $this->dropbox->get_view_url($stud_id); - $this->assertTrue(is_null($res)); + //$this->assertTrue(is_null($res)); //var_dump($res); } @@ -37,7 +35,7 @@ class TestDropBoxLink extends UnitTestCase { public function __destruct() { // The destructor acts like a global tearDown for the class - require_once api_get_path(SYS_TEST_PATH).'teardown.inc.php'; + TestManager::delete_test_course('COURSEDROPBOXLINK'); } } ?> diff --git a/tests/main/gradebook/lib/be/evaluation.class.test.php b/tests/main/gradebook/lib/be/evaluation.class.test.php index df385a43a7..5ead1a63d9 100644 --- a/tests/main/gradebook/lib/be/evaluation.class.test.php +++ b/tests/main/gradebook/lib/be/evaluation.class.test.php @@ -1,27 +1,20 @@ UnitTestCase('Test Evaluation'); } - public function __construct() { // The constructor acts like a global setUp for the class - require_once api_get_path(SYS_TEST_PATH).'setup.inc.php'; global $date; + TestManager::create_test_course('COURSEEVALUATION'); $this->evaluation = new Evaluation(); $this->evaluation-> set_id (1); $this->evaluation-> set_name ('test'); $this->evaluation-> set_description ('test description'); $this->evaluation-> set_user_id (1); - $this->evaluation-> set_course_code ('COURSETEST'); + $this->evaluation-> set_course_code ('COURSEEVALUATION'); $this->evaluation-> set_category_id (1); $this->evaluation-> set_date ($date); $this->evaluation-> set_weight (1); @@ -291,7 +284,7 @@ class TestEvaluation extends UnitTestCase { } public function testset_course_code() { - $res = $this->evaluation->set_course_code('COURSETEST'); + $res = $this->evaluation->set_course_code('COURSEEVALUATION'); $this->assertTrue(is_null($res)); //var_dump($res); } @@ -347,7 +340,7 @@ class TestEvaluation extends UnitTestCase { public function __destruct() { // The destructor acts like a global tearDown for the class - require_once api_get_path(SYS_TEST_PATH).'teardown.inc.php'; + TestManager::delete_test_course('COURSEEVALUATION'); } } ?> diff --git a/tests/main/gradebook/lib/be/exerciselink.class.test.php b/tests/main/gradebook/lib/be/exerciselink.class.test.php index 5e10f8358a..a2164b8312 100644 --- a/tests/main/gradebook/lib/be/exerciselink.class.test.php +++ b/tests/main/gradebook/lib/be/exerciselink.class.test.php @@ -1,9 +1,4 @@ exerciselink = new ExerciseLink(); - $this->exerciselink->set_course_code('COURSETEST'); + $this->exerciselink-> set_id (1); + $this->exerciselink-> set_name ('test'); + $this->exerciselink-> set_description ('test description'); + $this->exerciselink-> set_user_id (1); + $this->exerciselink-> set_course_code ('COURSEEXERCISELINK'); + $this->exerciselink-> set_category_id (1); + $this->exerciselink-> set_date ($date); + $this->exerciselink-> set_weight (1); + $this->exerciselink-> set_max (1); + $this->exerciselink-> set_visible (1); + } + + /** + * Generate an array of all exercises available. + * @return array 2-dimensional array - every element contains 2 subelements (id, name) + */ + + public function testget_all_links() { + $res = $this->exerciselink->get_all_links(); + $this->assertTrue(is_array($res)); + //var_dump($res); } /** @@ -31,16 +47,7 @@ class TestExerciseLink extends UnitTestCase { //var_dump($res); } - /** - * Generate an array of all exercises available. - * @return array 2-dimensional array - every element contains 2 subelements (id, name) - */ - - public function testget_all_links() { - $res = $this->exerciselink->get_all_links(); - $this->assertTrue(is_array($res)); - //var_dump($res); - } + /** * Get description to display: same as exercise description @@ -139,7 +146,7 @@ class TestExerciseLink extends UnitTestCase { public function __destruct() { // The destructor acts like a global tearDown for the class - require_once api_get_path(SYS_TEST_PATH).'teardown.inc.php'; + TestManager::delete_test_course('COURSEEXERCISELINK'); } } ?>