Commenting adding @deprecated in some scorm unused functions see #4716

skala
Julio Montoya 13 years ago
parent 68bd7b998c
commit f088d75e21
  1. 3
      main/gradebook/lib/gradebook_functions.inc.php
  2. 1
      main/newscorm/scorm.lib.php
  3. 56
      tests/main/newscorm/scorm.lib.test.php

@ -854,7 +854,4 @@ function score_badges($list_values) {
}
return Display::badge_group($badges);
}

@ -68,6 +68,7 @@ function removescormDir($dir) {
* This function removes a directory if it exists
* @param string Dir path
* @return boolean True on success, false otherwise
* @deprecated
* @uses removescormDir() to actually remove the directory
*/
function scorm_delete($file) {

@ -1,5 +1,5 @@
<?php
require_once(api_get_path(SYS_CODE_PATH).'newscorm/scorm.lib.php');
require_once api_get_path(SYS_CODE_PATH).'newscorm/scorm.lib.php';
class TestScormLib extends UnitTestCase {
@ -19,16 +19,15 @@ class TestScormLib extends UnitTestCase {
$curdir='';
$attribute=array('abc');
$res=get_scorm_paths_from_dir($basedir, $curdir, &$attribute);
$this->assertTrue(is_array($res));
//var_dump($res);
$this->assertTrue(is_array($res));
}
/**
* Detects the SCORM version from an imsmanifest.xml file
* @param string Path to imsmanifest.xml
* @return string SCORM version (1.0,1.1,1.2,1.3)
* @todo Implement this public function
*/
/**
* Detects the SCORM version from an imsmanifest.xml file
* @param string Path to imsmanifest.xml
* @return string SCORM version (1.0,1.1,1.2,1.3)
* @todo Implement this public function
*/
public function testget_scorm_version() {
$path_name = api_get_path(SYS_COURSE_PATH);
$path=$path_name.'scorm/';
@ -36,41 +35,4 @@ class TestScormLib extends UnitTestCase {
$this->assertTrue(is_string($res));
//var_dump($res);
}
/**
* Delete a scorm directory (check for imsmanifest and if found, deletes the related rows in scorm tables also)
* @param string Dir path
* @return boolean True on success, false otherwise
*/
public function testremovescormDirFalse() {
$path_name = api_get_path(SYS_COURSE_PATH);
$dir=$path_name.'scorm/';
$res=removescormDir($dir);
$this->assertFalse($res);
//var_dump($res);
}
public function testremovescormDirTrue() {
$path_name = api_get_path(SYS_COURSE_PATH);
$dir=$path_name.'scorm/';
$res=removescormDir($dir);
$this->assertTrue(is_bool($res));
//var_dump($res);
}
/**
* This public function removes a directory if it exists
* @param string Dir path
* @return boolean True on success, false otherwise
* @uses removescormDir() to actually remove the directory
*/
public function testscorm_delete() {
require_once(api_get_path(LIBRARY_PATH).'fileManage.lib.php');
$path_name = api_get_path(SYS_COURSE_PATH);
$file=$path_name.'scorm/';
$res=scorm_delete($file);
$this->assertTrue(is_bool($res));
//var_dump($res);
}
}
?>
}
Loading…
Cancel
Save