1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468 |
- <?php
- require_once(api_get_path(SYS_CODE_PATH).'newscorm/learnpath.class.php');
- class TestLearnpath extends UnitTestCase {
- const course = 'COURSETEST';
- public function testAddItem() {
- //ob_start();
- $parent = 2;
- $previous = 1;
- $type = 'dokeos_chapter';
- $id = 1;
- $title = 'Titulo';
- $description = 'Descripcion';
- $prerequisites = 0;
- $max_time_allowed = 0;
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->add_item($parent, $previous, $type, $id, $title, $description, $prerequisites, $max_time_allowed);
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testAddLp() {
- //ob_start();
- $name = '';
- $description = '';
- $learnpath = 'guess';
- $origin = 'zip';
- $zipname = '';
- $res = learnpath::add_lp(self::course, $name, $description, $learnpath, $origin, $zipname);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testAppendMessage() {
- //ob_start();
- $string = '';
- $res = learnpath::append_message($string);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testAutocompleteParents() {
- //ob_start();
- $item = 1;
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->autocomplete_parents($item);
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- var_dump($res);
- }
- */
- public function testAutosave() {
- //ob_start();
- $res = learnpath::autosave();
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testBuildActionMenu() {
- ob_start();
- $res = learnpath::build_action_menu();
- $this->assertTrue(is_null($res));
- ob_end_clean();
- //var_dump($res);
- }
- public function testClearMessage() {
- //ob_start();
- $res = learnpath::clear_message();
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testClose() {
- //ob_start();
- $res = learnpath::close();
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testCreateDocument() {
- //ob_start();
- $_course = '';
- $res = learnpath::create_document($_course);
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testCreateJs() {
- //ob_start();
- $res = learnpath::create_js();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- */
- public function testCreatePath() {
- //ob_start();
- $path = '';
- $res = learnpath::create_path($path);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testCreateTreeArray() {
- //ob_start();
- $array = '';
- $parent = 0;
- $depth = -1;
- $tmp = array ();
- $res = learnpath::create_tree_array($array, $parent, $depth, $tmp);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testDisplayDocument() {
- //ob_start();
- $id = 1;
- $show_title = false;
- $iframe = true;
- $edit_link = false;
- $res = learnpath::display_document($id, $show_title, $iframe, $edit_link);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testDisplayDocumentForm() {
- //ob_start();
- $action = 'add';
- $id = 0;
- $extra_info = 'new';
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->display_document_form($action, $id, $extra_info);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- */
- public function testDisplayEditItem() {
- //ob_start();
- $item_id = '';
- $res = learnpath::display_edit_item($item_id);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testDisplayForumForm() {
- //ob_start();
- $action = 'add';
- $id = 0;
- $extra_info = '';
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->display_forum_form($action, $id, $extra_info);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testDisplayHotpotatoesForm() {
- //ob_start();
- $action = 'add';
- $id = 0;
- $extra_info = '';
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->display_hotpotatoes_form($action, $id, $extra_info);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- */
- public function testDisplayItem() {
- //ob_start();
- $item_id = '';
- $iframe = true;
- $msg = '';
- $res = learnpath::display_item($item_id, $iframe, $msg);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /* public function testDisplayItemForm() {
- //ob_start();
- $item_type = '';
- $title = '';
- $action = 'add';
- $id = 0;
- $extra_info = 'new';
- $course='COURSETEST';
- $lp_id = 1;
- $user_id = 1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->display_item_form($item_type, $title, $action, $id, $extra_info);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testDisplayItemPrerequisitesForm() {
- //ob_start();
- $item_id = '';
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->display_item_prerequisites_form($item_id);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- */
- public function testDisplayItemSmallForm() {
- //ob_start();
- $item_type = '';
- $title = '';
- $data = '';
- $res = learnpath::display_item_small_form($item_type, $title, $data);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testDisplayLinkForm() {
- //ob_start();
- $action = 'add';
- $id = 0;
- $extra_info = '';
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->display_link_form($action, $id, $extra_info);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testDisplayManipulate() {
- //ob_start();
- $item_id = '';
- $item_type = TOOL_DOCUMENT;
- $res = learnpath::display_manipulate($item_id, $item_type);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- */
- public function testDisplayMoveItem() {
- //ob_start();
- $item_id = '';
- $res = learnpath::display_move_item($item_id);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testDisplayQuizForm() {
- //ob_start();
- $action = 'add';
- $id = 0;
- $extra_info = '';
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->display_quiz_form($action, $id, $extra_info);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- */
- /* public function testDisplayResources() {
- //ob_start();
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->display_resources();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testDisplayStudentPublicationForm() {
- //ob_start();
- $action = 'add';
- $id = 0;
- $extra_info = '';
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->display_student_publication_form($action, $id, $extra_info);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testDisplayThreadForm() {
- //ob_start();
- $action = 'add';
- $id = 0;
- $extra_info = '';
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->display_thread_form($action, $id, $extra_info);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- */
- public function testEditDocument() {
- //ob_start();
- $_course='';
- $res = learnpath::edit_document($_course);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testEditItem() {
- //ob_start();
- $id = '';
- $parent = '';
- $previous = '';
- $title = '';
- $description = '';
- $prerequisites = 0;
- $audio = NULL;
- $max_time_allowed = 0;
- $res = learnpath::edit_item($id, $parent, $previous, $title, $description, $prerequisites, $audio, $max_time_allowed);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testEditItemPrereq() {
- //ob_start();
- $id = '';
- $prerequisite_id = '';
- $mastery_score = 0;
- $max_score = 100;
- $res = learnpath::edit_item_prereq($id, $prerequisite_id, $mastery_score, $max_score);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testExportLp() {
- //ob_start();
- $type = 'scorm';
- $id = 1;
- $zipname = 'FILE';
- $res = learnpath::export_lp($type, self::course, $id, $zipname);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testFirst() {
- //ob_start();
- $res = learnpath::first();
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetAuthor() {
- //ob_start();
- $res = learnpath::get_author();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetBrotherChapters() {
- //ob_start();
- $id = '';
- $res = learnpath::get_brother_chapters($id);
- $this->assertTrue(is_array($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetBrotherItems() {
- //ob_start();
- $id = '';
- $res = learnpath::get_brother_items($id);
- $this->assertTrue(is_array($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testGetCommonIndexTermsByPrefix() {
- //ob_start();
- $prefix = '';
- $res = learnpath::get_common_index_terms_by_prefix($prefix);
- $this->assertTrue(is_array($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetCompleteItemsCount() {
- //ob_start();
- $res = learnpath::get_complete_items_count();
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- */
- public function testGetCurrentItemId() {
- //ob_start();
- $res = learnpath::get_current_item_id();
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetDocuments() {
- //ob_start();
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->get_documents();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetExercises() {
- //ob_start();
- $res = learnpath::get_exercises();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetExtension() {
- //ob_start();
- $filename = 'file';
- $res = learnpath::get_extension($filename);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetFirstItemId() {
- //ob_start();
- $res = learnpath::get_first_item_id();
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetFlatOrderedItemsList() {
- //ob_start();
- $lp = 1;
- $parent = 0;
- $res = learnpath::get_flat_ordered_items_list($lp, $parent);
- $this->assertTrue(is_array($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testGetForums() {
- //ob_start();
- //require_once api_get_path(WEB_PATH).('forum/forumpublic function.inc.php');
- //require_once api_get_path(WEB_PATH).('forum/forumconfig.inc.php');
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->get_forums();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetHtmlToc() {
- //ob_start();
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->get_html_toc();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- */
- public function testGetId() {
- //ob_start();
- $res = learnpath::get_id();
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetInteractionsCountFromDb() {
- //ob_start();
- $lp_iv_id = 0;
- $res = learnpath::get_interactions_count_from_db($lp_iv_id);
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testGetItemsDetailsAsJs() {
- //ob_start();
- $varname='olms.lms_item_types';
- $res = learnpath::get_items_details_as_js($varname);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetItemsStatusList() {
- //ob_start();
- $res = learnpath::get_items_status_list();
- $this->assertTrue(is_array($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetIvInteractionsArray() {
- //ob_start();
- $lp_iv_id = '';
- $res = learnpath::get_iv_interactions_array($lp_iv_id);
- $this->assertTrue(is_array($res));
- //ob_end_clean();
- //var_dump($res);
- }
- */
- public function testGetIvObjectivesArray() {
- //ob_start();
- $lp_iv_id = 0;
- $res = learnpath::get_iv_objectives_array($lp_iv_id);
- $this->assertTrue(is_array($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testGetJsInfo() {
- //ob_start();
- $item_id = '';
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->get_js_info($item_id);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- } */
- public function testGetJsLib() {
- //ob_start();
- $res = learnpath::get_js_lib();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetLast() {
- //ob_start();
- $res = learnpath::get_last();
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetLink() {
- //ob_start();
- $type = 'http';
- $item_id = null;
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->get_link($type, $item_id);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetLinks() {
- //ob_start();
- $res = learnpath::get_links();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetLpSessionId() {
- //ob_start();
- $res = learnpath::get_lp_session_id();
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetMaker() {
- //ob_start();
- $res = learnpath::get_maker();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetMediaplayer() {
- //ob_start();
- $autostart='true';
- $res = learnpath::get_mediaplayer($autostart);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetMessage() {
- //ob_start();
- $res = learnpath::get_message();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetName() {
- //ob_start();
- $res = learnpath::get_name();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetNavigationBar() {
- //ob_start();
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->get_navigation_bar();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetNextIndex() {
- //ob_start();
- $res = learnpath::get_next_index();
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetNextItemId() {
- //ob_start();
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->get_next_item_id();
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetObjectivesCountFromDb() {
- //ob_start();
- $lp_iv_id = 0;
- $res = learnpath::get_objectives_count_from_db($lp_iv_id);
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testGetPackageType() {
- //ob_start();
- $file_path = '';
- $file_name = '';
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->get_package_type($file_path, $file_name);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }*/
- public function testGetPreviewImage() {
- //ob_start();
- $res = learnpath::get_preview_image();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetPreviousIndex() {
- //ob_start();
- $res = learnpath::get_previous_index();
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetPreviousItemId() {
- //ob_start();
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->get_previous_item_id();
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetProgress() {
- //ob_start();
- $res = learnpath::get_progress();
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetProgressBar() {
- //ob_start();
- $mode = '';
- $percentage = -1;
- $text_add = '';
- $from_lp = false;
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->get_progress_bar($mode, $percentage, $text_add, $from_lp);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetProgressBarMode() {
- //ob_start();
- $res = learnpath::get_progress_bar_mode();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetProgressBarText() {
- //ob_start();
- $mode = '';
- $add = 0;
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->get_progress_bar_text($mode, $add);
- $this->assertTrue(is_array($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetProximity() {
- //ob_start();
- $res = learnpath::get_proximity();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetScormPrereqString() {
- //ob_start();
- $item_id = 1;
- $res = learnpath::get_scorm_prereq_string($item_id);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetScormXmlNode() {
- //ob_start();
- $children = 'children';
- $id = 1;
- $res = learnpath::get_scorm_xml_node($children, $id);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetStats() {
- //ob_start();
- $res = learnpath::get_stats();
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetStatsCourse() {
- //ob_start();
- $course = '';
- $res = learnpath::get_stats_course($course);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetStatsLp() {
- //ob_start();
- $lp = 1;
- $res = learnpath::get_stats_lp(self::course, $lp);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetStatsLpUser() {
- //ob_start();
- $lp = 1;
- $user = 1;
- $res = learnpath::get_stats_lp_user(self::course, $lp, $user);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetStatsUser() {
- //ob_start();
- $user = 1;
- $res = learnpath::get_stats_user(self::course, $user);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetStudentPublications() {
- //ob_start();
- $res = learnpath::get_student_publications();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetTheme() {
- //ob_start();
- $res = learnpath::get_theme();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testGetToc() {
- //ob_start();
- $res = learnpath::get_toc();
- $this->assertTrue(is_array($res));
- //ob_end_clean();
- //var_dump($res);
- }
- */
- public function testGetTotalItemsCount() {
- //ob_start();
- $res = learnpath::get_total_items_count();
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testGetTotalItemsCountWithoutChapters() {
- //ob_start();
- $res = learnpath::get_total_items_count_without_chapters();
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- */
- public function testGetType() {
- //ob_start();
- $get_name = false;
- $res=learnpath::get_type($get_name) ;
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetTypeStatic() {
- //ob_start();
- $lp_id = 0;
- $res = learnpath::get_type_static($lp_id);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetUpdateQueue() {
- //ob_start();
- $res = learnpath::get_update_queue();
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testGetUserId() {
- //ob_start();
- $res = learnpath::get_user_id();
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testGetView() {
- //ob_start();
- $attempt_num = 0;
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->get_view($attempt_num);
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- */
- public function testGetViewId() {
- //ob_start();
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->get_view_id();
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testHasAudio() {
- //ob_start();
- $res = learnpath::has_audio();
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }*/
- public function testLearnpath() {
- //ob_start();
- $course = '';
- $lp_id = '';
- $user_id = '';
- $res = learnpath::__construct($course, $lp_id, $user_id);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testLog() {
- //ob_start();
- $msg = '';
- $res = learnpath::log($msg);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testMoveDown() {
- //ob_start();
- $lp_id = 0;
- $res = learnpath::move_down($lp_id);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testMoveItem() {
- //ob_start();
- $id = 1;
- $direction = '';
- $res = learnpath::move_item($id, $direction);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testMoveUp() {
- //ob_start();
- $lp_id = 0;
- $res = learnpath::move_up($lp_id);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testNext() {
- //ob_start();
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->next();
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- } */
- public function testOpen() {
- //ob_start();
- $id = '';
- $res = learnpath::open($id);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testOverview() {
- //ob_start();
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->overview();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- */
- public function testPrerequisitesMatch() {
- //ob_start();
- $item = null;
- $res = learnpath::prerequisites_match($item);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testPrevious() {
- //ob_start();
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->previous();
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- */
- /*public function testRestart() {
- //ob_start();
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->restart();
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }*/
- public function testSaveCurrent() {
- //ob_start();
- $res = learnpath::save_current();
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testSaveItem() {
- //ob_start();
- $item_id = null;
- $from_outside = true;
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->save_item($item_id, $from_outside);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testSaveLast() {
- //ob_start();
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->save_last();
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testScormExport() {
- //ob_start();
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->scorm_export();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- */
- public function testSetAuthor() {
- //ob_start();
- $name = '';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->set_author($name);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testSetCurrentItem() {
- //ob_start();
- $item_id = null;
- $res = learnpath::set_current_item($item_id);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testSetEncoding() {
- //ob_start();
- $enc = 'ISO-8859-15';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->set_encoding($enc);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testSetErrorMsg() {
- //ob_start();
- $error = '';
- $res = learnpath::set_error_msg($error);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testSetJslib() {
- //ob_start();
- $lib = '';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->set_jslib($lib);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testSetMaker() {
- //ob_start();
- $name = '';
- $res = learnpath::set_maker($name);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testSetName() {
- //ob_start();
- $name = '';
- $res = learnpath::set_name($name);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testSetPreviewImage() {
- //ob_start();
- $name = '';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->set_preview_image($name);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testSetPreviousItem() {
- //ob_start();
- $id = '';
- $res = learnpath::set_previous_item($id);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testSetProximity() {
- //ob_start();
- $name = '';
- $res = learnpath::set_proximity($name);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testSetTermsByPrefix() {
- //ob_start();
- $terms_string = '';
- $prefix = '';
- $res = learnpath::set_terms_by_prefix($terms_string, $prefix);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testSetTheme() {
- //ob_start();
- $name = '';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->set_theme($name);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testSortTreeArray() {
- //ob_start();
- $array = '';
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->sort_tree_array($array);
- $this->assertTrue(is_array($res));
- //ob_end_clean();
- //var_dump($res);
- }
- */
- public function testStartCurrentItem() {
- //ob_start();
- $allow_new_attempt = false;
- $res = learnpath::start_current_item($allow_new_attempt);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testStopPreviousItem() {
- //ob_start();
- $res = learnpath::stop_previous_item();
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testTogglePublish() {
- //ob_start();
- $lp_id = '';
- $set_visibility = 'v';
- $res = learnpath::toggle_publish($lp_id, $set_visibility);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- */
- public function testToggleVisibility() {
- //ob_start();
- $lp_id = '';
- $set_visibility = 1;
- $res = learnpath::toggle_visibility($lp_id, $set_visibility);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testTreeArray() {
- //ob_start();
- $array = '';
- $res = learnpath::tree_array($array);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- */
- public function testUpdateDefaultScormCommit() {
- //ob_start();
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->update_default_scorm_commit();
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testUpdateDefaultViewMode() {
- //ob_start();
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->update_default_view_mode();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testUpdateDisplayOrder() {
- //ob_start();
- $res = learnpath::update_display_order();
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testUpdateReinit() {
- //ob_start();
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->update_reinit();
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testUpdateScormDebug() {
- //ob_start();
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->update_scorm_debug();
- $this->assertTrue(is_numeric($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testUploadImage() {
- //ob_start();
- $image_array = '';
- $res = learnpath::upload_image($image_array);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testWriteResourcesTree() {
- //ob_start();
- $resources_sorted = '';
- $num = 0;
- $res = learnpath::write_resources_tree($resources_sorted, $num);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testDelete() {
- //ob_start();
- $course = null;
- $id = null;
- $delete = 'keep';
- $course='COURSETEST';
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath($course, $lp_id, $user_id);
- $res = $obj->delete($course, $id, $delete);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }*/
- public function testDeleteChildrenItems() {
- //ob_start();
- $id = '';
- $res = learnpath::delete_children_items($id);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testDeleteItem() {
- //ob_start();
- $id = '';
- $remove = 'keep';
- $res = learnpath::delete_item($id, $remove);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- public function testDeleteLpImage() {
- //ob_start();
- $lp_id=1;
- $user_id=1;
- $obj = new learnpath(self::course, $lp_id, $user_id);
- $res = $obj->delete_lp_image();
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
- }
- ?>
|