From 435ae3ccfcf9e1aef31c76fab01e61090b81ab27 Mon Sep 17 00:00:00 2001 From: Arthur Portugal Date: Wed, 3 Feb 2010 18:49:54 -0500 Subject: [PATCH] Updated the file test suite with the files of tests running well CT#191 --- tests/test_suite.php | 146 +++++++++++++++++++------------------------ 1 file changed, 64 insertions(+), 82 deletions(-) diff --git a/tests/test_suite.php b/tests/test_suite.php index af258dfb6f..ee451f0ff2 100755 --- a/tests/test_suite.php +++ b/tests/test_suite.php @@ -2,23 +2,24 @@ //Set the time limit for the tests ini_set('memory_limit','256M'); +ini_set('max_execution_time','0'); $maindir = dirname(__FILE__).'/../main/'; $libdir = dirname(__FILE__).'/../main/inc/lib/'; -$incdir = dirname(__FILE__).'/../main/inc/'; + +$incdir = dirname(__FILE__).'/../main/inc/'; //Need the ob start and clean else will show the objects require_once $incdir.'global.inc.php'; //List of files than need the tests -ob_start(); require_once 'simpletest/unit_tester.php'; require_once 'simpletest/web_tester.php'; require_once 'simpletest/mock_objects.php'; require_once 'simpletest/autorun.php'; -ob_start(); require_once $libdir.'urlmanager.lib.php'; require_once $libdir.'fileDisplay.lib.php'; +require_once $maindir.'permissions/permissions_functions.inc.php'; require_once $libdir.'groupmanager.lib.php'; require_once $libdir.'course.lib.php'; require_once $libdir.'usermanager.lib.php'; @@ -26,7 +27,7 @@ require_once $libdir.'social.lib.php'; require_once $libdir.'xht.lib.php'; require_once $libdir.'xmd.lib.php'; require_once $libdir.'formvalidator/FormValidator.class.php'; -ob_end_clean(); + //Need the ob start and clean else will show the objects @@ -39,20 +40,19 @@ require_once $incdir.'tool_navigation_menu.inc.php'; require_once $incdir.'banner.inc.php'; ob_end_clean(); - //List of files than need the tests since chamilo -ob_start(); -require_once $maindir.'permissions/permissions_functions.inc.php'; require_once $maindir.'admin/calendar.lib.php'; require_once $maindir.'admin/statistics/statistics.lib.php'; +require_once $incdir.'lib/usermanager.lib.php'; require_once $maindir.'survey/survey.lib.php'; require_once $maindir.'install/install_upgrade.lib.php'; require_once $incdir.'lib/fileManage.lib.php'; -ob_end_clean(); class AllTestsSuite extends TestSuite { function setUp() { + global $_configuration, $_user, $_course, $cidReq; + $cidReq = 'COURSEX'; // check if course exists $table_course = Database::get_main_table(TABLE_MAIN_COURSE); @@ -117,97 +117,79 @@ class AllTestsSuite extends TestSuite { $_SESSION['_user']['user_id'] = 1; $_user['user_id'] = $_SESSION['_user']['user_id']; $_SESSION['is_courseAdmin'] = 1; + $_SESSION['show'] = showall; } function AllTestsSuite() { - ob_start(); $this->setUp(); $this->TestSuite('All tests suite'); - //List of files from all.test.php - - //funciones corregidas por Ricardo - $this->addTestFile(dirname(__FILE__).'/main/inc/lib/add_course.lib.inc.test.php'); - $this->addTestFile(dirname(__FILE__).'/main/inc/lib/blog.lib.test.php'); - $this->addTestFile(dirname(__FILE__).'/main/inc/lib/classmanager.lib.test.php'); - $this->addTestFile(dirname(__FILE__).'/main/inc/lib/course.lib.test.php'); - $this->addTestFile(dirname(__FILE__).'/main/inc/lib/database.lib.test.php'); - $this->addTestFile(dirname(__FILE__).'/main/inc/lib/debug.lib.inc.test.php'); - $this->addTestFile(dirname(__FILE__).'/main/inc/lib/display.lib.test.php'); -// $this->addTestFile(dirname(__FILE__).'/main/inc/lib/document.lib.test.php'); - $this->addTestFile(dirname(__FILE__).'/main/inc/lib/events.lib.inc.test.php'); -// $this->addTestFile(dirname(__FILE__).'/main/inc/lib/export.lib.inc.test.php'); - $this->addTestFile(dirname(__FILE__).'/main/inc/lib/fileDisplay.lib.test.php'); - $this->addTestFile(dirname(__FILE__).'/main/inc/lib/fileManage.lib.test.php'); - $this->addTestFile(dirname(__FILE__).'/main/inc/lib/fileUpload.lib.test.php'); - $this->addTestFile(dirname(__FILE__).'/main/inc/lib/geometry.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/legal.lib.test.php'); - $this->addTestFile(dirname(__FILE__).'/main/inc/lib/mail.lib.inc.test.php'); - - - //faltan corregir estas funciones - -// $this->addTestFile(dirname(__FILE__).'/main/inc/lib/main_api.lib.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/security.lib.test.php'); -*/ - - //carlos -// $this->addTestFile(dirname(__FILE__).'/main/inc/lib/stats.lib.inc.test.php'); -// $this->addTestFile(dirname(__FILE__).'/main/inc/lib/surveymanager.lib.test.php'); -// $this->addTestFile(dirname(__FILE__).'/main/inc/lib/system_announcements.lib.test.php'); - - //$this->addTestFile(dirname(__FILE__).'/main/inc/lib/usermanager.lib.test.php'); - //$this->addTestFile(dirname(__FILE__).'/main/inc/lib/xht.lib.test.php'); - //$this->addTestFile(dirname(__FILE__).'/main/inc/lib/xmd.lib.test.php'); - - //Funciones probadas por carlos - -// $this->addTestFile(dirname(__FILE__).'/main/inc/lib/tracking.lib.test.php'); -// $this->addTestFile(dirname(__FILE__).'/main/inc/lib/urlmanager.lib.test.php'); - -/* + //funciones q faltan corregir parta carlos +/* + $this->addTestFile(dirname(__FILE__).'/main/inc/lib/system_announcements.lib.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/inc/lib/xht.lib.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/inc/lib/xmd.lib.test.php'); +*/ + //Funciones probadas + $this->addTestFile(dirname(__FILE__).'/main/install/install_upgrade.lib.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/inc/lib/database.lib.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/inc/lib/add_course.lib.inc.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/inc/lib/course.lib.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/inc/banner.lib.test.php'); $this->addTestFile(dirname(__FILE__).'/main/inc/lib/session_handler.class.test.php'); - $this->addTestFile(dirname(__FILE__).'/main/inc/lib/sessionmanager.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/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'); -*/ - //Funciones corregidas por Arthur - //List of files from all.test1.php - $this->addTestFile(dirname(__FILE__).'/main/inc/banner.lib.test.php'); - $this->addTestFile(dirname(__FILE__).'/main/inc/course_document.lib.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/inc/lib/sessionmanager.lib.test.php'); + $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/message.lib.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/social.lib.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'); + $this->addTestFile(dirname(__FILE__).'/main/inc/lib/tracking.lib.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/inc/lib/blog.lib.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/inc/lib/urlmanager.lib.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/inc/lib/stats.lib.inc.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/inc/course_document.lib.test.php'); $this->addTestFile(dirname(__FILE__).'/main/inc/tool_navigation_menu.inc.test.php'); - //List of files from all.test2.php - $this->addTestFile(dirname(__FILE__).'/main/admin/calendar.lib.test.php'); - $this->addTestFile(dirname(__FILE__).'/main/admin/statistics/statistics.lib.test.php'); - $this->addTestFile(dirname(__FILE__).'/main/auth/lost_password.lib.test.php'); -/* $this->addTestFile(dirname(__FILE__).'/main/auth/openid/xrds.lib.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/inc/lib/display.lib.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/inc/lib/document.lib.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/inc/lib/events.lib.inc.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/inc/lib/fileDisplay.lib.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/inc/lib/fileManage.lib.test.php'); + //$this->addTestFile(dirname(__FILE__).'/main/inc/lib/geometry.lib.test.php'); + //$this->addTestFile(dirname(__FILE__).'/main/admin/calendar.lib.test.php'); + //$this->addTestFile(dirname(__FILE__).'/main/admin/statistics/statistics.lib.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/admin/sub_language.class.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/auth/lost_password.lib.test.php'); + $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/work/work.lib.test.php'); - $this->addTestFile(dirname(__FILE__).'/main/install/install_upgrade.lib.test.php'); - //List of files from all.test3.php - $this->addTestFile(dirname(__FILE__).'/main/admin/sub_language.class.test.php'); -*/ -ob_end_clean(); + $this->addTestFile(dirname(__FILE__).'/main/work/work.lib.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/inc/lib/surveymanager.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/main_api.lib.test.php');//al final + $this->addTestFile(dirname(__FILE__).'/main/inc/lib/debug.lib.inc.test.php'); + //$this->addTestFile(dirname(__FILE__).'/main/inc/lib/fileUpload.lib.test.php'); } } $test = &new AllTestsSuite(); -?> +?> \ No newline at end of file