course_document.lib.test.php 991 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. class Testcdocu extends UnitTestCase{
  3. public function __construct(){
  4. $this->UnitTestCase('Course documents display library - main/inc/course_document.inc.test.php');
  5. }
  6. public function testGetlist(){
  7. global $is_allowed_in_course;
  8. $is_allowed_in_course = true;
  9. $directory = api_get_path(SYS_COURSE_PATH).'/document/audio/';
  10. $res = getlist($directory);
  11. if (is_bool($res)){
  12. $this->assertTrue(is_bool($res));
  13. $this->assertTrue($res ===false);
  14. } else{
  15. $this->assertTrue(is_null($res));
  16. }
  17. }
  18. public function testCheckAndCreateResourceDirectory(){
  19. global $_course, $_user;
  20. global $group_properties, $to_group_id;
  21. global $permissions_for_new_directories;
  22. $repository_path='';
  23. $resource_directory='';
  24. $resource_directory_name='';
  25. $res = check_and_create_resource_directory($repository_path, $resource_directory, $resource_directory_name);
  26. $this->assertTrue(is_bool($res));
  27. $this->assertTrue($res === true || $res === false);
  28. }
  29. }