diff --git a/tests/main/inc/lib/tracking.lib.test.php b/tests/main/inc/lib/tracking.lib.test.php index e11bbc842e..b8bbc6a34b 100755 --- a/tests/main/inc/lib/tracking.lib.test.php +++ b/tests/main/inc/lib/tracking.lib.test.php @@ -1,10 +1,28 @@ assertTrue(is_string($res)); + } + } + + function testget_first_connection_date_on_the_course() { + global $_course; + $student_id=''; + $course_code=$_course; + $res=Tracking::get_first_connection_date_on_the_course($student_id, $course_code); + if(!is_null($res))$this->assertTrue(is_bool($res)); + //var_dump($res); + } + + function testchat_connections_during_last_x_days_by_course() { global $_course; $course_code=$_course; @@ -16,18 +34,6 @@ class TestTracking extends UnitTestCase { //var_dump($docman); } - - function testchat_last_connection() { - require_once (api_get_path(LIBRARY_PATH) . 'course.lib.php'); - global $_course; - $student_id= $_POST['student_id']; - $course_code= $_course; - $this->tracking = new Tracking(); - $res=$this->tracking->chat_last_connection($student_id,$course_code); - $this->assertTrue(is_object($this->tracking)); - if(!is_string($res))$this->assertTrue(is_null($res)); - } - function testcount_course_per_student() { $user_id=1; $this->tracking = new Tracking(); @@ -161,22 +167,18 @@ class TestTracking extends UnitTestCase { } function testget_avg_student_score() { - $docman = new Database(); global $_user,$_course; $student_id=$_user; - $course_code=''; - $this->tracking = new Tracking(); + $course_code=$_course; $res=$this->tracking->get_avg_student_score($student_id, $course_code, $lp_ids=array()); - if(!is_string($res))$this->assertTrue(is_null($res)); //var_dump($res); } function testget_course_list_in_session_from_student() { - //setUp (not practica$session_idl to have a real SetUp() here) global $_user; - $student_id=$_user; + $user_id = $_user; $session_id= 1; $res=Tracking::get_course_list_in_session_from_student($user_id, $session_id); $this->assertTrue(is_array($res)); @@ -197,22 +199,6 @@ class TestTracking extends UnitTestCase { //var_dump($res); } - function testget_first_connection_date() { - global $_user; - $student_id=$_user; - $res=Tracking::get_first_connection_date($student_id); - if(!is_null($res))$this->assertTrue(is_string($res)); - } - - function testget_first_connection_date_on_the_course() { - global $_course; - $student_id=''; - $course_code=$_course; - $res=Tracking::get_first_connection_date_on_the_course($student_id, $course_code); - if(!is_null($res))$this->assertTrue(is_bool($res)); - //var_dump($res); - } - function testget_inactives_students_in_course() { global $_course; $course_code = $_course; @@ -223,20 +209,6 @@ class TestTracking extends UnitTestCase { //var_dump($res); } - function testget_last_connection_date() { - $student_id=1; - $res=Tracking::get_last_connection_date($student_id); - if(!is_null($res))$this->assertTrue(is_string($res)); - } - - function testget_last_connection_date_on_the_course() { - $student_id=''; - $course_code=''; - $res=Tracking::get_last_connection_date_on_the_course($student_id, $course_code); - if(!is_null($res))$this->assertTrue(is_bool($res)); - //var_dump($res); - } - function testget_sessions_coached_by_user() { $coach_id=''; $res=Tracking::get_sessions_coached_by_user($coach_id); @@ -288,5 +260,30 @@ class TestTracking extends UnitTestCase { if(!is_null($res))$this->assertTrue(is_bool($res)); //var_dump($res); } + + function testchat_last_connection() { + require_once (api_get_path(LIBRARY_PATH) . 'course.lib.php'); + global $_course; + $student_id= $_POST['student_id']; + $course_code= $_course; + $this->tracking = new Tracking(); + $res=$this->tracking->chat_last_connection($student_id,$course_code); + $this->assertTrue(is_object($this->tracking)); + if(!is_string($res))$this->assertTrue(is_null($res)); + } + + function testget_last_connection_date() { + $student_id=1; + $res=Tracking::get_last_connection_date($student_id); + if(!is_bool($res))$this->assertTrue(is_string($res)); + } + + function testget_last_connection_date_on_the_course() { + $student_id=''; + $course_code=''; + $res=Tracking::get_last_connection_date_on_the_course($student_id, $course_code); + if(!is_null($res))$this->assertTrue(is_bool($res)); + //var_dump($res); + } } ?> diff --git a/tests/main/work/work.lib.test.php b/tests/main/work/work.lib.test.php index 93dd9cd2be..e071af807e 100755 --- a/tests/main/work/work.lib.test.php +++ b/tests/main/work/work.lib.test.php @@ -417,7 +417,7 @@ class TestWork extends UnitTestCase { session_destroy(); } */ - public function testDeleteCourse() { +/* public function testDeleteCourse() { $code = 'COURSEX'; $res = CourseManager::delete_course($code); $path = api_get_path(SYS_PATH).'archive'; @@ -432,6 +432,6 @@ class TestWork extends UnitTestCase { closedir($handle); } session_destroy(); - } + }*/ } ?>