浏览代码

[svn r21703] Added document.lib.test

Arthur Portugal 15 年之前
父节点
当前提交
90d6513dec
共有 1 个文件被更改,包括 53 次插入0 次删除
  1. 53 0
      tests/main/inc/lib/document.lib.test.php

+ 53 - 0
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);
+	}
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+	
+}
+?>