123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- <?php
- require_once(api_get_path(SYS_CODE_PATH).'newscorm/learnpath.class.php');
- require_once(api_get_path(SYS_CODE_PATH).'newscorm/scorm.class.php');
- class TestScormClass extends UnitTestCase {
- /*
- public function testScorm() {
- //ob_start();
- $course_code = 'COURSETEST';
- $resource_id = 1;
- $user_id = 1;
- $obj = new scorm($course_code, $resource_id, $user_id);
- $res = $obj->scorm($course_code=null,$resource_id=null,$user_id=null);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }*/
- public function testOpen() {
- //ob_start();
- $id = 1;
- $res = scorm::open($id);
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
-
- public function testParseManifest() {
- //ob_start();
- $course_code = 'COURSETEST';
- $resource_id = 1;
- $user_id = 1;
- $obj = new scorm($course_code, $resource_id, $user_id);
- $res = $obj->parse_manifest($file='');
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
-
- public function testImportManifest() {
- //ob_start();
- $course_code = 'COURSETEST';
- $resource_id = 1;
- $user_id = 1;
- $obj = new scorm($course_code, $resource_id, $user_id);
- $res = $obj->import_manifest($course_code = 'COURSETEST');
- $this->assertTrue(is_null($res));
- //ob_end_clean();
- //var_dump($res);
- }
- /*
- public function testImportLocalPackage() {
- //ob_start();
- $course_code = 'COURSETEST';
- $resource_id = 1;
- $user_id = 1;
- $obj = new scorm($course_code, $resource_id, $user_id);
- $res = $obj->import_local_package($file_path,$current_dir='');
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
-
- public function testImportPackage() {
- //ob_start();
- $course_code = 'COURSETEST';
- $resource_id = 1;
- $user_id = 1;
- $obj = new scorm($course_code, $resource_id, $user_id);
- $res = $obj->import_package($zip_file_info,$current_dir = '');
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }*/
-
- public function testSetProximity() {
- //ob_start();
- $course_code = 'COURSETEST';
- $resource_id = 1;
- $user_id = 1;
- $obj = new scorm($course_code, $resource_id, $user_id);
- $res = $obj->set_proximity($proxy='');
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
-
- public function testSetTheme() {
- //ob_start();
- $course_code = 'COURSETEST';
- $resource_id = 1;
- $user_id = 1;
- $obj = new scorm($course_code, $resource_id, $user_id);
- $res = $obj->set_theme($theme='Chamilo');
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
-
- public function testSetPreviewImage() {
- //ob_start();
- $course_code = 'COURSETEST';
- $resource_id = 1;
- $user_id = 1;
- $obj = new scorm($course_code, $resource_id, $user_id);
- $res = $obj->set_preview_image($preview_image='');
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
-
- public function testSetAuthor() {
- //ob_start();
- $course_code = 'COURSETEST';
- $resource_id = 1;
- $user_id = 1;
- $obj = new scorm($course_code, $resource_id, $user_id);
- $res = $obj->set_author($author='');
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
-
- public function testSetMaker() {
- //ob_start();
- $course_code = 'COURSETEST';
- $resource_id = 1;
- $user_id = 1;
- $obj = new scorm($course_code, $resource_id, $user_id);
- $res = $obj->set_maker($maker='');
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
-
- public function testExportZip() {
- //ob_start();
- $course_code = 'COURSETEST';
- $resource_id = 1;
- $user_id = 1;
- $obj = new scorm($course_code, $resource_id, $user_id);
- $res = $obj->export_zip($lp_id=null);
- $this->assertTrue(is_bool($res));
- //ob_end_clean();
- //var_dump($res);
- }
-
- public function testGetResPath() {
- //ob_start();
- $res = scorm::get_res_path($id=1);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
-
- public function testGetResType() {
- //ob_start();
- $res = scorm::get_res_type($id = 1);
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
-
- public function testGetTitle() {
- //ob_start();
- $res = scorm::get_title();
- $this->assertTrue(is_string($res));
- //ob_end_clean();
- //var_dump($res);
- }
-
- public function testReimportManifest() {
- ob_start();
- $course_code = 'COURSETEST';
- $resource_id = 1;
- $user_id = 1;
- $obj = new scorm($course_code, $resource_id, $user_id);
- $res = $obj->reimport_manifest($course = 'COURSETEST',$lp_id=null,$imsmanifest_path='');
- $this->assertTrue(is_bool($res));
- ob_end_clean();
- //var_dump($res);
- }
- }
- ?>
|