123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <?php
- class TestInstallUpgrade extends UnitTestCase{
- public function TestInstallUpgrade() {
- $this->UnitTestCase('testing the function used by '.
- 'the install and upgrade scripts');
- }
- public function testSetFileFolderPermissions() {
- $res = set_file_folder_permissions();
- $this->assertTrue(is_null($res));
- $this->assertNull($res);
-
- }
- public function testFillTrackCountriesTable() {
- $track_countries_table='';
- $res = fill_track_countries_table($track_countries_table);
- $this->assertEqual(null,$res);
-
- }
- public function testWriteCoursesHtaccessFile() {
- $chamilo_path_folder = api_get_path(SYS_PATH);
- $url_append=$chamilo_path_folder.'main/install/';
- $res = write_courses_htaccess_file($url_append);
- if(is_bool($res)){
- $this->assertTrue(is_bool($res));
- $this->assertTrue($res === true || $res === false);
- }else
- $this->assertEqual($chamilo_path_folder.'main/install/',$res);
-
- }
-
-
- public function testLoadDatabaseScript() {
- $chamilo_path_folder= api_get_path(SYS_PATH);
- $db_script= $chamilo_path_folder.'main/install/db_stats.sql';
- $res = load_database_script($db_script);
- $this->assertTrue(is_null($res));
- }
- public function testSplitSqlFile() {
- $ret='';
- $sql='';
- $res = split_sql_file($ret, $sql);
- $this->assertTrue($res);
- $this->assertTrue(is_bool($res));
- $this->assertTrue($res===true);
- }
- public function testGetSqlFileContents() {
- ob_start();
- $file='txt';
- $section='course';
- $print_errors=true;
- $res = get_sql_file_contents($file,$section,$print_errors);
- ob_end_clean();
- if(is_bool($res));
- $this->assertTrue(is_bool($res));
- $this->assertTrue($res===true || $res === false);
-
- }
- public function testMyDirectoryToArray() {
- $chamilo_path_folder= api_get_path(SYS_PATH);
- $directory= $chamilo_path_folder.'home';
- $res = my_directory_to_array($directory);
- $this->assertTrue(is_array($res));
- }
-
- }
- ?>
|