[svn r21703] Added document.lib.test

skala
Arthur Portugal 16 years ago
parent 7dddac1eb5
commit 90d6513dec
  1. 53
      tests/main/inc/lib/document.lib.test.php

@ -0,0 +1,53 @@
<?php
require_once(api_get_path(LIBRARY_PATH).'document.lib.php');
class TestDocumentManager extends UnitTestCase {
/**
* This check if a document has the readonly property checked, then see if the user
* is the owner of this file, if all this is true then return true.
*
* @param array $_course
* @param int $user_id id of the current user
* @param string $file path stored in the database
* @param int $document_id in case you dont have the file path ,insert the id of the file here and leave $file in blank ''
* @return boolean true/false
**/
public function testcheck_readonly() {
$_course='';
$user_id='';
$file='';
$res=DocumentManager::check_readonly($_course,$user_id,$file);
$this->assertTrue(is_bool($res));
//var_dump($res);
}
}
?>
Loading…
Cancel
Save