123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347 |
- <?php
- class TestEvaluation extends UnitTestCase {
- public function TestEvaluation() {
- $this->UnitTestCase('Test Evaluation');
- }
- public function __construct() {
- $this->UnitTestCase('Gradebook evaluation library - main/gradebook/lib/be/evaluation.class.test.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 ('COURSEEVALUATION');
- $this->evaluation-> set_category_id (1);
- $this->evaluation-> set_date ($date);
- $this->evaluation-> set_weight (1);
- $this->evaluation-> set_max (1);
- $this->evaluation-> set_visible (1);
- }
-
- public function testadd() {
- $res = $this->evaluation->add();
- $this->assertTrue(is_null($res));
-
- }
- public function testadd_evaluation_log() {
- $idevaluation = 1;
- $res = $this->evaluation->add_evaluation_log($idevaluation);
- $this->assertTrue(is_null($res));
-
- }
-
- public function testcalc_score() {
- $res = $this->evaluation->calc_score($stud_id = null);
- $this->assertTrue(is_null($res));
-
- }
-
- public function testdelete() {
- $res = $this->evaluation->delete();
- $this->assertTrue(is_null($res));
-
- }
-
- public function testdelete_results() {
- $res = $this->evaluation->delete_results();
- $this->assertTrue(is_null($res));
-
- }
-
- public function testdelete_with_results() {
- $res = $this->evaluation->delete_with_results();
- $this->assertTrue(is_null($res));
-
- }
-
- public function testdoes_name_exist() {
- $name = 'test name';
- $parent = 1;
- $res = $this->evaluation->does_name_exist($name, $parent);
- $this->assertTrue(is_bool($res));
-
- }
-
-
-
- public function testget_category_id() {
- $res = $this->evaluation->get_category_id();
- $this->assertTrue(is_numeric($res));
-
- }
- public function testget_course_code() {
- $res = $this->evaluation->get_course_code();
- $this->assertTrue(is_string($res));
-
- }
- public function testget_date() {
- $res = $this->evaluation->get_date();
- $this->assertTrue(is_null($res));
-
- }
- public function testget_description() {
- $res = $this->evaluation->get_description();
- $this->assertTrue(is_string($res));
-
- }
-
- public function testget_evaluations_with_result_for_student() {
- $stud_id = 1;
- $res = $this->evaluation->get_evaluations_with_result_for_student($cat_id = null, $stud_id);
- $this->assertTrue(is_array($res));
-
- }
- public function testget_icon_name() {
- $res = $this->evaluation->get_icon_name();
- $this->assertTrue(is_string($res));
-
- }
- public function testget_id() {
- $res = $this->evaluation->get_id();
- $this->assertTrue(is_numeric($res));
-
- }
- public function testget_item_type() {
- $res = $this->evaluation->get_item_type();
- $this->assertTrue(is_string($res));
-
- }
- public function testget_max() {
- $res = $this->evaluation->get_max();
- $this->assertTrue(is_numeric($res));
-
- }
- public function testget_name() {
- $res = $this->evaluation->get_name();
- $this->assertTrue(is_string($res));
-
- }
-
- public function testget_not_subscribed_students() {
- $res = $this->evaluation->get_not_subscribed_students($first_letter_user = '');
- $this->assertTrue(is_array($res));
-
- }
-
- public function testget_target_categories() {
- $res = $this->evaluation->get_target_categories();
- $this->assertTrue(is_array($res));
-
- }
- public function testget_user_id() {
- $res = $this->evaluation->get_user_id();
- $this->assertTrue(is_numeric($res));
-
- }
- public function testget_weight() {
- $res = $this->evaluation->get_weight();
- $this->assertTrue(is_numeric($res));
-
- }
-
- public function testhas_results() {
- $res = $this->evaluation->has_results();
- $this->assertTrue(is_bool($res));
-
- }
- public function testis_valid_score() {
- $score = 1;
- $res = $this->evaluation->is_valid_score($score);
- $this->assertTrue(is_bool($res));
-
- }
- public function testis_visible() {
- $res = $this->evaluation->is_visible();
- $this->assertTrue(is_numeric($res));
-
- }
-
- public function testload() {
- $res = $this->evaluation->load($id = null, $user_id = null, $course_code = null, $category_id = null, $visible = null);
- $this->assertTrue(is_array($res));
-
- }
-
- public function testmove_to_cat() {
- $cat = $this->evaluation;
- $res = $this->evaluation->move_to_cat($cat);
- $this->assertTrue(is_null($res));
-
- }
-
- public function testsave() {
- $res = $this->evaluation->save();
- $this->assertTrue(is_null($res));
-
- }
- public function testset_category_id() {
- $res = $this->evaluation->set_category_id(1);
- $this->assertTrue(is_null($res));
-
- }
- public function testset_course_code() {
- $res = $this->evaluation->set_course_code('COURSEEVALUATION');
- $this->assertTrue(is_null($res));
-
- }
- public function testset_date() {
- global $date;
- $res = $this->evaluation->set_date('02/02/2010');
- $this->assertTrue(is_null($res));
-
- }
- public function testset_description() {
- $res = $this->evaluation->set_description('test description');
- $this->assertTrue(is_null($res));
-
- }
- public function testset_id() {
- $res = $this->evaluation->set_id(1);
- $this->assertTrue(is_null($res));
-
- }
- public function testset_max() {
- $res = $this->evaluation->set_max(1);
- $this->assertTrue(is_null($res));
-
- }
- public function testset_name() {
- $res = $this->evaluation->set_name('test name');
- $this->assertTrue(is_null($res));
-
- }
- public function testset_user_id() {
- $res = $this->evaluation->set_user_id(1);
- $this->assertTrue(is_null($res));
-
- }
- public function testset_visible() {
- $res = $this->evaluation->set_visible(1);
- $this->assertTrue(is_null($res));
-
- }
- public function testset_weight() {
- $res = $this->evaluation->set_weight(1);
- $this->assertTrue(is_null($res));
-
- }
- public function __destruct() {
-
- TestManager::delete_test_course('COURSEEVALUATION');
- }
- }
- ?>
|