12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445 |
- <?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 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 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 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);
- }
- }
- ?>
|