diff --git a/tests/main/inc/lib/classmanager.lib.test.php b/tests/main/inc/lib/classmanager.lib.test.php index db71733504..818841ef0a 100755 --- a/tests/main/inc/lib/classmanager.lib.test.php +++ b/tests/main/inc/lib/classmanager.lib.test.php @@ -3,7 +3,7 @@ require_once(api_get_path(LIBRARY_PATH).'classmanager.lib.php'); class TestClassManager extends UnitTestCase { - public function TestClassManager(){ + public function __construct(){ $this->UnitTestCase('Class (students) manager library - main/inc/lib/classmanager.lib.test.php'); } function testAddUser() { diff --git a/tests/main/inc/lib/export.lib.inc.test.php b/tests/main/inc/lib/export.lib.inc.test.php index 518927f26d..120a2e7a0b 100755 --- a/tests/main/inc/lib/export.lib.inc.test.php +++ b/tests/main/inc/lib/export.lib.inc.test.php @@ -4,16 +4,16 @@ require_once(api_get_path(LIBRARY_PATH).'document.lib.php'); /** Test about export csv using class document manager * @author Arthur portugal - * To can test and show the var_dump is necesary comment inside the class - * DocumentManager in the file document.lib.php the word "exit()", because + * To can test and show the var_dump is necesary comment inside the class + * DocumentManager in the file document.lib.php the word "exit()", because * "exit" not permit show the result. */ class TestExport extends UnitTestCase { - + public function __construct() { - $this->UnitTestCase('Export library tests'); + $this->UnitTestCase('Export library - main/inc/lib/export.lib.inc.test.php'); } - + /** * Checks the export_table_csv method. * @todo check that a new file is created in api_get_path(SYS_ARCHIVE_PATH) @@ -26,7 +26,7 @@ class TestExport extends UnitTestCase { $this->assertFalse($res); ob_end_clean(); } - + function testExportTableXls() { $data = array(); @@ -49,7 +49,7 @@ class TestExport extends UnitTestCase { $this->assertFalse($res); ob_end_clean(); } - + function testExportComplexTableXml() { $data = array(); $filename = 'export'; @@ -70,7 +70,7 @@ class TestExport extends UnitTestCase { $this->assertTrue(is_string($res)); ob_end_clean(); } - + function testBackupDatabase() { $link=''; $db_name=''; @@ -96,9 +96,9 @@ class TestExport extends UnitTestCase { }*/ function testmakeTheBackup() { - global $error_msg, $error_no, $db, $archiveRepositorySys, + global $error_msg, $error_no, $db, $archiveRepositorySys, $archiveRepositoryWeb, $appendCourse, $appendMainDb, $archiveName, - $_configuration, $_course, $TABLEUSER, $TABLECOURSUSER, + $_configuration, $_course, $TABLEUSER, $TABLECOURSUSER, $TABLECOURS, $TABLEANNOUNCEMENT; $exportedCourseId=''; $res=makeTheBackup($exportedCourseId); diff --git a/tests/main/inc/lib/legal.lib.test.php b/tests/main/inc/lib/legal.lib.test.php index 6d906efeda..aa7e1562bf 100755 --- a/tests/main/inc/lib/legal.lib.test.php +++ b/tests/main/inc/lib/legal.lib.test.php @@ -3,9 +3,8 @@ require_once(api_get_path(LIBRARY_PATH).'legal.lib.php'); class TestLegal extends UnitTestCase{ - public function TestLegal(){ - - $this->UnitTestCase(''); + public function __construct() { + $this->UnitTestCase('Legal terms library - main/inc/lib/legal.lib.test.php'); } public function testAdd(){ diff --git a/tests/main/inc/lib/mail.lib.inc.test.php b/tests/main/inc/lib/mail.lib.inc.test.php index 81ca4a2493..28f948dadd 100755 --- a/tests/main/inc/lib/mail.lib.inc.test.php +++ b/tests/main/inc/lib/mail.lib.inc.test.php @@ -3,6 +3,10 @@ require_once(api_get_path(LIBRARY_PATH).'mail.lib.inc.php'); class TestMail extends UnitTestCase { + public function __construct() { + $this->UnitTestCase('Mailing library - main/inc/lib/mail.lib.inc.test.php'); + } + function testApiMail() { ob_start(); $recipient_name=''; diff --git a/tests/main/inc/lib/message.lib.test.php b/tests/main/inc/lib/message.lib.test.php index 749fce974f..2c9bf4b735 100755 --- a/tests/main/inc/lib/message.lib.test.php +++ b/tests/main/inc/lib/message.lib.test.php @@ -3,6 +3,10 @@ require_once(api_get_path(LIBRARY_PATH).'message.lib.php'); class TestMessage extends UnitTestCase { + public function __construct() { + $this->UnitTestCase('Messages library - main/inc/lib/message.lib.test.php'); + } + function testGetNumberOfMessagesMask() { $res=get_number_of_messages_mask(); $this->assertTrue(is_string($res)); diff --git a/tests/main/inc/lib/online.inc.test.php b/tests/main/inc/lib/online.inc.test.php index 9b2a490d0d..39624a6db4 100755 --- a/tests/main/inc/lib/online.inc.test.php +++ b/tests/main/inc/lib/online.inc.test.php @@ -6,6 +6,10 @@ require_once(api_get_path(LIBRARY_PATH).'online.inc.php'); class TestOnline extends UnitTestCase { + public function __construct() { + $this->UnitTestCase('Online (chat) library - main/inc/lib/online.inc.test.php'); + } + function testchatcall() { global $_user, $_cid; $webpath=api_get_path(WEB_CODE_PATH); @@ -93,7 +97,7 @@ class TestOnline extends UnitTestCase { $valid=''; $res=who_is_online($valid); $this->assertTrue(is_array($res)); - //var_dump($res); + //var_dump($res); } } ?> diff --git a/tests/main/inc/lib/security.lib.test.php b/tests/main/inc/lib/security.lib.test.php index 8958665799..e43bf52b40 100755 --- a/tests/main/inc/lib/security.lib.test.php +++ b/tests/main/inc/lib/security.lib.test.php @@ -6,6 +6,10 @@ class TestSecurity extends UnitTestCase { public $clean = array(); + public function __construct() { + $this->UnitTestCase('Security library - main/inc/lib/security.lib.test.php'); + } + function testcheck_abs_path() { $abs_path=''; $checker_path=''; diff --git a/tests/main/inc/lib/social.lib.test.php b/tests/main/inc/lib/social.lib.test.php index b1a5c48322..822da0654c 100755 --- a/tests/main/inc/lib/social.lib.test.php +++ b/tests/main/inc/lib/social.lib.test.php @@ -4,13 +4,12 @@ require_once(api_get_path(LIBRARY_PATH).'usermanager.lib.php'); require_once(api_get_path(LIBRARY_PATH).'main_api.lib.php'); class TestSocial extends UnitTestCase{ - /* - public $social; - public function TestSocial(){ - - $this->UnitTestCase('All main social function tests'); - } + //public $social; + public function __construct() { + $this->UnitTestCase('Social network library - main/inc/lib/social.lib.test.php'); + } +/* public function setUp(){ $this->social = new SocialManager(); } @@ -19,31 +18,7 @@ class TestSocial extends UnitTestCase{ $this->social = null; } */ - //@todo this function was moved to usermanager - - /** - * this function has been eliminated of this file, this functionality has been implemented in other file - */ -/* DEPRECATED - public function testRegisterFriend(){ - $friend_id=4; - $my_user_id=1; - $relation_type=2; - $res= SocialManager::register_friend ($friend_id,$my_user_id,$relation_type); - $this->assertTrue(is_null($res)); - $this->assertNull($res); - //var_dump($res); - } - - -//Remove or deprecate - public function testRemovedFriend(){ - $friend_id=4; - $res = SocialManager::removed_friend($friend_id); - $this->assertTrue(is_null($res)); - //var_dump($res); - } -*/ + public function testShowListTypeFriends(){ $res =SocialManager::show_list_type_friends(); $this->assertTrue($res); @@ -58,7 +33,7 @@ class TestSocial extends UnitTestCase{ { $this->assertNull($res); $this->assertTrue(is_null($res)); - } else + } else { $this->assertTrue(is_numeric($res)); $this->assertTrue($res); @@ -74,27 +49,14 @@ class TestSocial extends UnitTestCase{ $this->assertFalse($res); $this->assertTrue(is_numeric($res)); } else - { + { $this->assertTrue(is_string($res)); $this->assertTrue($res); } //var_dump($res); } -/** - * This function has been DEPRECATED AND REMOVED - */ -/* DEPRECATED - public function testGetListIdFriendsByUserId (){ - $user_id = 1; - $id_group=3; - $search_name='group'; - $res = SocialManager::get_friends_id($user_id,$id_group,$search_name); - $this->assertTrue(is_array($res)); - //var_dump($res); - } -*/ - + public function testGetListPathWebByUserId(){ $user_id=1; $id_group=null; @@ -186,22 +148,5 @@ class TestSocial extends UnitTestCase{ } //var_dump($res); } -/* - public function TestDeleteCourse(){ - $code = 'COURSETEST'; - $res = CourseManager::delete_course($code); - $path = api_get_path(SYS_PATH).'archive'; - if ($handle = opendir($path)) { - while (false !== ($file = readdir($handle))) { - if (strpos($file,$code)!==false) { - if (is_dir($path.'/'.$file)) { - rmdirr($path.'/'.$file); - } - } - } - closedir($handle); - } - } -*/ } -?> +?> \ No newline at end of file diff --git a/tests/main/inc/lib/sortabletable.class.test.php b/tests/main/inc/lib/sortabletable.class.test.php index b979599103..9c6ec2507e 100755 --- a/tests/main/inc/lib/sortabletable.class.test.php +++ b/tests/main/inc/lib/sortabletable.class.test.php @@ -4,6 +4,9 @@ require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php'; class TestSortableTable extends UnitTestCase { + public function __construct() { + $this->UnitTestCase('Sortabletable library - main/inc/lib/sortabletable.class.test.php'); + } function testdisplay() { $instancia = new SortableTable(); diff --git a/tests/main/inc/lib/specific_fields_manager.lib.test.php b/tests/main/inc/lib/specific_fields_manager.lib.test.php index f739894f39..2fcad724e2 100755 --- a/tests/main/inc/lib/specific_fields_manager.lib.test.php +++ b/tests/main/inc/lib/specific_fields_manager.lib.test.php @@ -3,6 +3,10 @@ require_once(api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php'); class TestSpecificFieldsManager extends UnitTestCase { + public function __construct() { + $this->UnitTestCase('Specific (extra) fields library - main/inc/lib/specific_fields_manager.lib.test.php'); + } + function testadd_specific_field() { $name=''; $res=add_specific_field($name); diff --git a/tests/main/inc/lib/stats.lib.inc.test.php b/tests/main/inc/lib/stats.lib.inc.test.php index 16936d9c7b..17f8d961f5 100755 --- a/tests/main/inc/lib/stats.lib.inc.test.php +++ b/tests/main/inc/lib/stats.lib.inc.test.php @@ -2,6 +2,10 @@ require_once(api_get_path(LIBRARY_PATH).'stats.lib.inc.php'); class TestStats extends UnitTestCase { + public function __construct() { + $this->UnitTestCase('System stats library - main/inc/lib/stats.lib.test.php'); + } + function testaddBrowser() { $browser=''; $browsers_array=array(); @@ -51,8 +55,8 @@ class TestStats extends UnitTestCase { function testdecodeOpenInfos() { // 3 excepciones //ob_start(); - global $_course, $TABLETRACK_OPEN, $_configuration; - $TABLETRACK_OPEN = $_configuration['statistics_database']."`.`track_e_open"; + global $_course, $TABLETRACK_OPEN, $_configuration; + $TABLETRACK_OPEN = $_configuration['statistics_database']."`.`track_e_open"; $ignore = ignore_user_abort(); $res=decodeOpenInfos(); //ob_end_clean(); @@ -60,10 +64,10 @@ class TestStats extends UnitTestCase { $this->assertTrue(is_null($res)); $this->assertTrue(is_numeric($ignore)); //var_dump($res); - } + } } - function testextractAgent() { + function testextractAgent() { $user_agent=$_SERVER['HTTP_USER_AGENT']; $list_browsers=array(); $list_os=array(); diff --git a/tests/main/inc/lib/statsUtils.lib.inc.test.php b/tests/main/inc/lib/statsUtils.lib.inc.test.php index 06942aba6b..bbe3332f9b 100755 --- a/tests/main/inc/lib/statsUtils.lib.inc.test.php +++ b/tests/main/inc/lib/statsUtils.lib.inc.test.php @@ -4,6 +4,10 @@ require_once(api_get_path(LIBRARY_PATH).'statsUtils.lib.inc.php'); class TestStatsUtils extends UnitTestCase { + public function __construct() { + $this->UnitTestCase('Stats utilities library - main/inc/lib/statsUtil.lib.inc.test.php'); + } + function testbuildTab2col() { $array_of_results=array(); $title1=''; diff --git a/tests/main/inc/lib/tablesort.lib.test.php b/tests/main/inc/lib/tablesort.lib.test.php index 79891441a7..49ceca9e87 100755 --- a/tests/main/inc/lib/tablesort.lib.test.php +++ b/tests/main/inc/lib/tablesort.lib.test.php @@ -1,15 +1,12 @@ UnitTestCase('Tablesort library tests'); + public function __construct(){ + $this->UnitTestCase('Tablesort library - main/inc/lib/tablesort.lib.test.php'); } /* public function setUp(){ diff --git a/tests/main/inc/lib/urlmanager.lib.test.php b/tests/main/inc/lib/urlmanager.lib.test.php index 1558d7244f..07e45b9e57 100755 --- a/tests/main/inc/lib/urlmanager.lib.test.php +++ b/tests/main/inc/lib/urlmanager.lib.test.php @@ -3,6 +3,10 @@ require_once(api_get_path(LIBRARY_PATH).'urlmanager.lib.php'); class TestUrlManager extends UnitTestCase { + public function __construct() { + $this->UnitTestCase('URL manager library - main/inc/lib/urlmanager.lib.test.php'); + } + function testadd() { $url=''; $description=''; @@ -127,7 +131,7 @@ class TestUrlManager extends UnitTestCase { } function testrelation_url_course_exist() { - $course_id = 'COURSETEST'; + $course_id = 'COURSETEST'; $url_id=1; $resu=UrlManager::relation_url_course_exist($course_id, $url_id); if(!is_numeric($resu)){