resourcelinker.inc.test.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <?php
  2. require_once api_get_path(SYS_CODE_PATH).'resourcelinker/resourcelinker.inc.php';
  3. class TestResourcelinker extends UnitTestCase {
  4. function testCheckAddedResources() {
  5. //ob_start();
  6. $type='';
  7. $id=1;
  8. $res = check_added_resources($type, $id);
  9. $this->assertTrue(is_bool($res));
  10. //ob_end_clean();
  11. //var_dump($res);
  12. }
  13. function testDisplayAddedResources() {
  14. //ob_start();
  15. $type=1;
  16. $id=1;
  17. $style='';
  18. $res = display_added_resources($type, $id, $style);
  19. if(!is_null($res))
  20. $this->assertTrue(is_resource($res));
  21. //ob_end_clean();
  22. //var_dump($res);
  23. }
  24. function testDisplayAddedresourceLink() {
  25. //ob_start();
  26. $type='';
  27. $id=1;
  28. $style='';
  29. $res = display_addedresource_link($type, $id, $style);
  30. $this->assertTrue(is_null($res));
  31. //ob_end_clean();
  32. //var_dump($res);
  33. }
  34. function testDisplayAddedresourceLinkInLearnpath() {
  35. //ob_start();
  36. $type='';
  37. $id=1;
  38. $completed='';
  39. $id_in_path='';
  40. $builder='';
  41. $icon='';
  42. $level = 0;
  43. $res = display_addedresource_link_in_learnpath($type, $id, $completed, $id_in_path, $builder, $icon, $level);
  44. $this->assertTrue(is_null($res));
  45. //ob_end_clean();
  46. //var_dump($res);
  47. }
  48. function testDisplayResources() {
  49. //ob_start();
  50. $showdeleteimg='';
  51. $res = display_resources($showdeleteimg);
  52. $this->assertTrue(is_null($res));
  53. //ob_end_clean();
  54. //var_dump($res);
  55. }
  56. function testEdit_addedResources() {
  57. //ob_start();
  58. $type='';
  59. $id=1;
  60. $res = edit_added_resources($type, $id);
  61. $this->assertTrue(is_null($res));
  62. //ob_end_clean();
  63. //var_dump($res);
  64. }
  65. function testFileOrFolder() {
  66. //ob_start();
  67. $filefolder='';
  68. $res = file_or_folder($filefolder);
  69. $this->assertTrue(is_numeric($res));
  70. //ob_end_clean();
  71. //var_dump($res);
  72. }
  73. function testGetAddedresourceLinkInLearnpath() {
  74. //ob_start();
  75. $type='';
  76. $id=1;
  77. $id_in_path='';
  78. $res = get_addedresource_link_in_learnpath($type, $id, $id_in_path);
  79. $this->assertTrue(is_string($res));
  80. //ob_end_clean();
  81. //var_dump($res);
  82. }
  83. function testShowAddresourceButton() {
  84. ob_start();
  85. $additionalparameters = '';
  86. $res = show_addresource_button($additionalparameters);
  87. $this->assertTrue(is_null($res));
  88. ob_end_clean();
  89. //var_dump($res);
  90. }
  91. function testShowDocuments() {
  92. ob_start();
  93. $folder='';
  94. $res = show_documents($folder);
  95. $this->assertTrue(is_null($res));
  96. ob_end_clean();
  97. //var_dump($res);
  98. }
  99. function testShowFolderUp() {
  100. //ob_start();
  101. $res = show_folder_up();
  102. $this->assertTrue(is_null($res));
  103. //ob_end_clean();
  104. //var_dump($res);
  105. }
  106. function testShoworhideAddresourcelink() {
  107. ob_start();
  108. $type='';
  109. $id=1;
  110. $res = showorhide_addresourcelink($type, $id);
  111. $this->assertTrue(is_null($res));
  112. ob_end_clean();
  113. //var_dump($res);
  114. }
  115. function testStoreResources() {
  116. //ob_start();
  117. $source_type='';
  118. $source_id='';
  119. $res = store_resources($source_type, $source_id);
  120. $this->assertTrue(is_null($res));
  121. //ob_end_clean();
  122. //var_dump($res);
  123. }
  124. function testUnsetSessionResources() {
  125. //ob_start();
  126. $res = unset_session_resources();
  127. $this->assertTrue(is_null($res));
  128. //ob_end_clean();
  129. //var_dump($res);
  130. }
  131. function testUpdateAddedResources() {
  132. //ob_start();
  133. $type='';
  134. $id=1;
  135. $res = update_added_resources($type, $id);
  136. $this->assertTrue(is_null($res));
  137. //ob_end_clean();
  138. //var_dump($res);
  139. }
  140. /*function testDeleteOneAddedResource() {
  141. //ob_start();
  142. $source_type='';
  143. $source_id=1;
  144. $resource_type='';
  145. $resource_id=1;
  146. $res =delete_one_added_resource($source_type, $source_id, $resource_type, $resource_id);
  147. $this->assertTrue(is_null($res));
  148. //ob_end_clean();
  149. //var_dump($res);
  150. }*/
  151. function testRemoveResource() {
  152. //ob_start();
  153. $resource_key='';
  154. $res = remove_resource($resource_key);
  155. $this->assertTrue(is_null($res));
  156. //ob_end_clean();
  157. //var_dump($res);
  158. }
  159. function testDeleteAddedResource() {
  160. //ob_start();
  161. $type='';
  162. $id=1;
  163. $res = delete_added_resource($type, $id);
  164. $this->assertTrue(is_null($res));
  165. //ob_end_clean();
  166. //var_dump($res);
  167. }
  168. function testDeleteAllResources_type() {
  169. //ob_start();
  170. $type='';
  171. $res = delete_all_resources_type($type);
  172. $this->assertTrue(is_null($res));
  173. //ob_end_clean();
  174. //var_dump($res);
  175. }
  176. }
  177. ?>