|
|
|
|
@ -8,7 +8,7 @@ $maindir = dirname(__FILE__).'/../main/'; |
|
|
|
|
$incdir = dirname(__FILE__).'/../main/inc/'; |
|
|
|
|
$libdir = dirname(__FILE__).'/../main/inc/lib/'; |
|
|
|
|
|
|
|
|
|
//Need the ob start and clean else will show the objects |
|
|
|
|
//Need the ob start and clean else will show the objects |
|
|
|
|
require_once $incdir.'global.inc.php'; |
|
|
|
|
|
|
|
|
|
//List of files than need the tests |
|
|
|
|
@ -28,7 +28,7 @@ require_once $libdir.'xmd.lib.php'; |
|
|
|
|
require_once $libdir.'formvalidator/FormValidator.class.php'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Need the ob start and clean else will show the objects |
|
|
|
|
//Need the ob start and clean else will show the objects |
|
|
|
|
ob_start(); |
|
|
|
|
require_once $libdir.'main_api.lib.php'; |
|
|
|
|
require_once $libdir.'course_document.lib.php'; |
|
|
|
|
@ -58,17 +58,17 @@ require_once $libdir.'fileManage.lib.php'; |
|
|
|
|
|
|
|
|
|
class TestsSuite extends TestSuite { |
|
|
|
|
function setUp() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
global $_configuration, $_user, $_course, $cidReq; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$cidReq = 'COURSETEST'; |
|
|
|
|
// check if course exists |
|
|
|
|
// check if course exists |
|
|
|
|
$table_course = Database::get_main_table(TABLE_MAIN_COURSE); |
|
|
|
|
$sql = "SELECT code FROM $table_course WHERE code = '$cidReq' "; |
|
|
|
|
$rs = Database::query($sql, __FILE__, __LINE__); |
|
|
|
|
$rs = Database::query($sql); |
|
|
|
|
$row = Database::fetch_row($rs); |
|
|
|
|
if (empty($row[0])) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// create a course |
|
|
|
|
$course_datos = array( |
|
|
|
|
'wanted_code'=> $cidReq, |
|
|
|
|
@ -85,7 +85,7 @@ class TestsSuite extends TestSuite { |
|
|
|
|
$course_datos['course_language'],$course_datos['course_admin_id'], |
|
|
|
|
$course_datos['db_prefix'], $course_datos['firstExpirationDelay']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$course_table = Database::get_main_table(TABLE_MAIN_COURSE); |
|
|
|
|
$course_cat_table = Database::get_main_table(TABLE_MAIN_CATEGORY); |
|
|
|
|
$sql = "SELECT course.*, course_category.code faCode, course_category.name faName |
|
|
|
|
@ -93,10 +93,10 @@ class TestsSuite extends TestSuite { |
|
|
|
|
LEFT JOIN $course_cat_table |
|
|
|
|
ON course.category_code = course_category.code |
|
|
|
|
WHERE course.code = '$cidReq'"; |
|
|
|
|
$result = Database::query($sql,__FILE__,__LINE__); |
|
|
|
|
|
|
|
|
|
$result = Database::query($sql); |
|
|
|
|
|
|
|
|
|
//create the session |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Database::num_rows($result)>0) { |
|
|
|
|
$cData = Database::fetch_array($result); |
|
|
|
|
$_cid = $cData['code' ]; |
|
|
|
|
@ -117,16 +117,16 @@ class TestsSuite extends TestSuite { |
|
|
|
|
$_course['visibility' ] = $cData['visibility']; |
|
|
|
|
$_course['subscribe_allowed'] = $cData['subscribe']; |
|
|
|
|
$_course['unubscribe_allowed'] = $cData['unsubscribe']; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
api_session_register('_cid'); |
|
|
|
|
api_session_register('_course'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$_SESSION['_user']['user_id'] = 1; |
|
|
|
|
|
|
|
|
|
$_SESSION['_user']['user_id'] = 1; |
|
|
|
|
$_user['user_id'] = $_SESSION['_user']['user_id']; |
|
|
|
|
$_SESSION['is_courseAdmin'] = 1; |
|
|
|
|
$_SESSION['show'] = showall; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
function TestsSuite() { |
|
|
|
|
$this->setUp(); |
|
|
|
|
@ -143,13 +143,13 @@ class TestsSuite extends TestSuite { |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/classmanager.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/export.lib.inc.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/legal.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/mail.lib.inc.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/mail.lib.inc.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/message.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/online.inc.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/online.inc.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/security.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/specific_fields_manager.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/specific_fields_manager.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/social.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/sortabletable.class.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/sortabletable.class.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/statsUtils.lib.inc.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/tablesort.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/text.lib.test.php'); |
|
|
|
|
@ -178,15 +178,15 @@ class TestsSuite extends TestSuite { |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/auth/openid/xrds.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/chat/chat_functions.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/conference/get_translation.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/exercice/hotpotatoes.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/exercice/hotpotatoes.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/newscorm/scorm.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/survey/survey.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/user/userInfoLib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/webservices/user_import/import.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/user/userInfoLib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/webservices/user_import/import.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/work/work.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/glossary.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/notebook.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/permissions/permissions_functions.inc.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/permissions/permissions_functions.inc.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/resourcelinker/resourcelinker.inc.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/survey/survey.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/dropbox/dropbox_class.inc.test.php'); |
|
|
|
|
@ -194,17 +194,17 @@ class TestsSuite extends TestSuite { |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/search/search_suggestions.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/exercice/export/qti2/qti2_classes.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/exercice/export/scorm/scorm_classes.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/usermanager.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/groupmanager.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/image.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/usermanager.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/groupmanager.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/image.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/import.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/internationalization.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/internationalization.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/system_announcements.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/fileUpload.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/main_api.lib.test.php');//this file delete the course |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/main_api.lib.test.php');//this file delete the course |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/debug.lib.inc.test.php');//this file need be to the finish of the tests |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
//This files has metadata, are deprecated, are not implemented and is not available for the test. |
|
|
|
|
//$this->addTestFile(dirname(__FILE__).'/main/inc/lib/xht.lib.test.php'); |
|
|
|
|
//$this->addTestFile(dirname(__FILE__).'/main/inc/lib/xmd.lib.test.php'); |
|
|
|
|
@ -212,18 +212,18 @@ class TestsSuite extends TestSuite { |
|
|
|
|
//$this->addTestFile(dirname(__FILE__).'/main/exercice/export/qti2/qti2_export.test.php'); |
|
|
|
|
//$this->addTestFile(dirname(__FILE__).'/main/exercice/export/exercise_import.inc.test.php'); |
|
|
|
|
//$this->addTestFile(dirname(__FILE__).'/main/exercice/export/scorm/scorm_export.test.php'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**EJERCICIOS**/ |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/exercice/answer.class.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/exercice/exercise_result.class.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/exercise_show_functions.lib.test.php'); |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/exercice/exercise.class.test.php'); |
|
|
|
|
|
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/main_api.lib.test.php');//this file delete the course |
|
|
|
|
|
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/main_api.lib.test.php');//this file delete the course |
|
|
|
|
$this->addTestFile(dirname(__FILE__).'/main/inc/lib/debug.lib.inc.test.php');//this file need be to the finish of the tests |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$test = &new TestsSuite(); |
|
|
|
|
|