document.lib.test.php 829 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. require_once(api_get_path(LIBRARY_PATH).'document.lib.php');
  3. class TestDocumentManager extends UnitTestCase {
  4. /**
  5. * This check if a document has the readonly property checked, then see if the user
  6. * is the owner of this file, if all this is true then return true.
  7. *
  8. * @param array $_course
  9. * @param int $user_id id of the current user
  10. * @param string $file path stored in the database
  11. * @param int $document_id in case you dont have the file path ,insert the id of the file here and leave $file in blank ''
  12. * @return boolean true/false
  13. **/
  14. public function testcheck_readonly() {
  15. $_course='';
  16. $user_id='';
  17. $file='';
  18. $res=DocumentManager::check_readonly($_course,$user_id,$file);
  19. $this->assertTrue(is_bool($res));
  20. //var_dump($res);
  21. }
  22. }
  23. ?>