Fixed the files all.test 2,3 within fails DT#191

skala
Arthur Portugal 15 years ago
parent a37b60ec76
commit b116c8177e
  1. 11
      tests/main/admin/calendar.lib.test.php
  2. 7
      tests/main/admin/statistics/statistics.lib.test.php
  3. 19
      tests/main/admin/sub_language.class.test.php

@ -648,16 +648,19 @@ class TestCalendar extends UnitTestCase {
}
public function testAgendaImportIcal(){
$course_info='course_test';
$file='';
$res = agenda_import_ical($course_info,$file);
$course_info = 'course_test';
$file_ical = '00000000000000-980.ics';
$file = api_get_path(SYS_PATH).'tests/main/admin/icals/'.$file_ical;
//var_dump($_FILES[$file_ical]);
$res = agenda_import_ical($course_info, $file);
//var_dump($res);
if(is_bool($res)){
$this->assertTrue(is_bool($res));
$this->assertTrue($res===false || $res === true);
}else{
$this->assertTrue($res);
}
//var_dump($res);
}

@ -136,9 +136,14 @@ class TestStatistics extends UnitTestCase{
WHERE track_default.default_user_id = user.user_id ";
$res = Database::query($sql, __FILE__, __LINE__);
$row = Database::fetch_row($res);
if (Database::num_rows($res) > 0) {
$this->assertTrue(is_array($row));
} else {
$this->assertFalse($row);
}
$resu = Statistics::get_activities_data($from, $number_of_items, $column, $direction);
$this->assertTrue(is_array($resu));
$this->assertTrue($row);
//var_dump($resu);
//var_dump($row);
//var_dump($res);

@ -13,11 +13,10 @@ class TestSubLanguageManager extends UnitTestCase {
* @return Array All file of dokeos folder
*/
public function testget_all_data_of_dokeos_folder(){
$dokeos_path_folder = '/var/www/dokeoshg1.8.6.1/';
$dokeos_path_folder = api_get_path(SYS_PATH);
$res = SubLanguageManager::get_all_data_of_dokeos_folder($dokeos_path_folder, $only_main_name = false);
$this->assertTrue(is_null($res));
$this->assertFalse($res);
//var_dump($res);
$this->assertTrue(is_array($res));
$this->assertTrue($res);
}
/**
@ -52,12 +51,12 @@ class TestSubLanguageManager extends UnitTestCase {
*
*/
public function testget_all_language_variable_in_file(){
$dokeos_path_file = '/var/www/dokeoshg1.8.6.1/main/lang/spanish/link.inc.php';
$res = SubLanguageManager::get_all_language_variable_in_file($dokeos_path_file);
$this->assertFalse($res);
$this->assertTrue(is_null($res));
//var_dump($res);
}
$dokeos_path_folder = api_get_path(SYS_LANG_PATH);
$dokeos_path_file = $dokeos_path_folder.'spanish/link.inc.php';
$res = SubLanguageManager::get_all_language_variable_in_file($dokeos_path_file);
$this->assertTrue(is_array($res));
$this->assertTrue($res);
}
/**
*

Loading…
Cancel
Save