Permalink
Browse files

Merge branch 'w17_MDL-32569_m23_phpunit5' of git://github.com/skodak/…

…moodle
  • Loading branch information...
2 parents eadff47 + fb8e3fa commit f48808810974ea3fafd297eefe8c18cbc8fb61a4 @danpoltawski danpoltawski committed Apr 23, 2012
Showing with 1,281 additions and 64,565 deletions.
  1. +0 −169 admin/tool/unittest/dbtest.php
  2. +0 −20 admin/tool/unittest/index.php
  3. +0 −94 admin/tool/unittest/other/test_tables.php
  4. +1 −2 admin/tool/unittest/settings.php
  5. +0 −167 backup/controller/simpletest/testcontroller.php
  6. +0 −463 backup/converter/moodle1/simpletest/testlib.php
  7. BIN backup/converter/moodle1/{simpletest/files → tests/fixtures}/icon.gif
  8. 0 backup/converter/moodle1/{simpletest/files → tests/fixtures}/moodle.xml
  9. 0 backup/converter/moodle1/{simpletest/files → tests/fixtures}/questions.xml
  10. +8 −8 backup/converter/moodle1/tests/lib_test.php
  11. +0 −228 backup/util/checks/simpletest/testcheck.php
  12. +0 −267 backup/util/dbops/simpletest/testdbops.php
  13. +0 −52 backup/util/destinations/simpletest/testdestination.php
  14. +0 −205 backup/util/factories/simpletest/testfactory.php
  15. +0 −146 backup/util/helper/simpletest/testconverthelper.php
  16. +0 −197 backup/util/helper/simpletest/testdecode.php
  17. +0 −55 backup/util/helper/simpletest/testhelper.php
  18. +0 −395 backup/util/loggers/simpletest/testlogger.php
  19. +0 −211 backup/util/plan/simpletest/testplan.php
  20. +0 −336 backup/util/plan/simpletest/teststep.php
  21. +0 −236 backup/util/plan/simpletest/testtask.php
  22. +0 −468 backup/util/settings/simpletest/testsettings.php
  23. +0 −123 backup/util/structure/simpletest/fixtures/structuremocks.php
  24. +0 −673 backup/util/structure/simpletest/testbackupstructures.php
  25. +0 −136 backup/util/structure/simpletest/testbaseatom.php
  26. +0 −71 backup/util/structure/simpletest/testbaseattribute.php
  27. +0 −176 backup/util/structure/simpletest/testbasefinalelement.php
  28. +0 −408 backup/util/structure/simpletest/testbasenestedelement.php
  29. +0 −150 backup/util/structure/simpletest/testbaseoptigroup.php
  30. +0 −46 backup/util/ui/simpletest/testui.php
  31. +30 −34 backup/util/xml/output/{simpletest/testoutput.php → tests/output_test.php}
  32. 0 backup/util/xml/parser/{simpletest → tests}/fixtures/test1.xml
  33. 0 backup/util/xml/parser/{simpletest → tests}/fixtures/test2.xml
  34. 0 backup/util/xml/parser/{simpletest → tests}/fixtures/test3.xml
  35. 0 backup/util/xml/parser/{simpletest → tests}/fixtures/test4.xml
  36. 0 backup/util/xml/parser/{simpletest → tests}/fixtures/test5.xml
  37. +201 −207 backup/util/xml/parser/{simpletest/testparser.php → tests/parser_test.php}
  38. +0 −329 backup/util/xml/simpletest/testwriter.php
  39. 0 backup/util/xml/{simpletest → tests}/fixtures/test1.xml
  40. +1 −1 backup/util/xml/tests/writer_test.php
  41. +0 −170 blog/simpletest/testbloglib.php
  42. +0 −4 config-dist.php
  43. +0 −136 course/simpletest/testcourselib.php
  44. +0 −114 filter/mediaplugin/simpletest/testfiltermediaplugin.php
  45. +0 −16 filter/urltolink/simpletest/sample.txt
  46. +0 −201 filter/urltolink/simpletest/testfilter.php
  47. +0 −172 grade/grading/simpletest/testlib.php
  48. +0 −57 grade/simpletest/testedittree.php
  49. +1 −1 lang/en/admin.php
  50. +0 −129 lib/ajax/simpletest/testajaxlib.php
  51. +0 −19 lib/ddl/simpletest/fixtures/invalid.xml
  52. +0 −19 lib/ddl/simpletest/fixtures/xmldb_table.xml
  53. +0 −1,864 lib/ddl/simpletest/testddl.php
  54. +1 −1 lib/ddl/tests/fixtures/invalid.xml
  55. +1 −1 lib/ddl/tests/fixtures/xmldb_table.xml
  56. +0 −197 lib/dml/simpletest/fixtures/clob.txt
  57. BIN lib/dml/simpletest/fixtures/randombinary
  58. +0 −4,628 lib/dml/simpletest/testdml.php
  59. +1 −1 lib/eventslib.php
  60. +0 −130 lib/form/simpletest/testduration.php
  61. +0 −660 lib/grade/simpletest/testgradecategory.php
  62. +0 −198 lib/grade/simpletest/testgradegrades.php
  63. +0 −559 lib/grade/simpletest/testgradeitem.php
  64. +0 −108 lib/grade/simpletest/testgradeoutcome.php
  65. +0 −133 lib/grade/simpletest/testgradescale.php
  66. +1 −1 lib/mathslib.php
  67. +3 −11 lib/moodlelib.php
  68. +1 −0 lib/phpunit/bootstrap.php
  69. +41 −4 lib/phpunit/lib.php
  70. 0 lib/simpletest/{portfolio_testclass.php → broken_portfolio_testclass.php}
  71. +0 −347 lib/simpletest/broken_testfilelib.php
  72. +0 −44 lib/simpletest/fixtures/events.php
  73. +0 −878 lib/simpletest/fixtures/gradetest.php
  74. +0 −57 lib/simpletest/fixtures/user_agents.php
  75. +0 −1,172 lib/simpletest/fulltestaccesslib.php
  76. +0 −46 lib/simpletest/testbackuplib.php
  77. +0 −399 lib/simpletest/testblocklib_blockmanager.php
  78. +0 −50 lib/simpletest/testcode.php
  79. +0 −698 lib/simpletest/testcompletionlib.php
  80. +0 −181 lib/simpletest/testcomponentlib.php
  81. +0 −385 lib/simpletest/testconditionlib.php
  82. +0 −721 lib/simpletest/testcsslib.php
  83. +0 −34 lib/simpletest/testdeprecatedlib.php
  84. +0 −225 lib/simpletest/testeventslib.php
  85. +0 −80 lib/simpletest/testexternallib.php
  86. +0 −91 lib/simpletest/testfilelib.php
  87. +0 −830 lib/simpletest/testfilterconfig.php
  88. +0 −223 lib/simpletest/testformslib.php
  89. +0 −46 lib/simpletest/testgradelib.php
  90. +0 −147 lib/simpletest/testhtml2text.php
  91. +0 −255 lib/simpletest/testhtmlpurifier.php
  92. +0 −97 lib/simpletest/testhtmlwriter.php
  93. +0 −221 lib/simpletest/testmathslib.php
  94. +0 −1,798 lib/simpletest/testmoodlelib.php
  95. +0 −513 lib/simpletest/testnavigationlib.php
  96. +0 −234 lib/simpletest/testoutputcomponents.php
  97. +0 −179 lib/simpletest/testoutputlib.php
  98. +0 −782 lib/simpletest/testpagelib_moodlepage.php
  99. +0 −62 lib/simpletest/testquestionlib.php
  100. +0 −68 lib/simpletest/testrepositorylib.php
  101. +0 −130 lib/simpletest/testrss.php
  102. +0 −422 lib/simpletest/testtextlib.php
  103. +0 −169 lib/simpletest/testweblib.php
  104. +78 −86 lib/tests/eventslib_test.php
  105. +2 −2 lib/tests/fixtures/events.php
  106. +6 −6 lib/tests/navigationlib_test.php
  107. 0 lib/{simpletest → tests/other}/completion.manualtest.txt
  108. +6 −7 {admin/tool/unittest → lib/tests}/other/pdflibtestpage.php
  109. +23 −7 {admin/tool/unittest → lib/tests}/other/todochecker.php
  110. +620 −0 lib/tests/pagelib_test.php
  111. +5 −3 {admin/tool/unittest/other → lib/tests/performance}/filtersettingsperformancetester.php
  112. +248 −249 lib/{simpletest/testpluginlib.php → tests/pluginlib_test.php}
  113. +1 −1 lib/tests/weblib_test.php
  114. +0 −245 mod/data/simpletest/test_advanced_search_sql.php
  115. +0 −833 mod/data/simpletest/test_context.csv
  116. +0 −2 mod/data/simpletest/test_course_modules.csv
  117. +0 −2,001 mod/data/simpletest/test_data_content.csv
  118. +0 −21 mod/data/simpletest/test_data_fields.csv
  119. +0 −101 mod/data/simpletest/test_data_records.csv
  120. +0 −21 mod/data/simpletest/test_modules.csv
  121. +0 −101 mod/data/simpletest/test_user.csv
  122. +0 −144 mod/lti/simpletest/testlocallib.php
  123. +0 −288 mod/quiz/accessrule/delaybetweenattempts/simpletest/testrule.php
  124. +0 −73 mod/quiz/accessrule/ipaddress/simpletest/testrule.php
  125. +0 −69 mod/quiz/accessrule/numattempts/simpletest/testrule.php
  126. +0 −180 mod/quiz/accessrule/openclosedate/simpletest/testrule.php
  127. +0 −58 mod/quiz/accessrule/password/simpletest/testrule.php
  128. +0 −62 mod/quiz/accessrule/safebrowser/simpletest/testrule.php
  129. +0 −58 mod/quiz/accessrule/securewindow/simpletest/testrule.php
  130. +0 −63 mod/quiz/accessrule/timelimit/simpletest/testrule.php
  131. +0 −79 mod/quiz/report/simpletest/testreportlib.php
  132. +0 −21 mod/quiz/report/statistics/simpletest/mdl_question.csv
  133. +0 −441 mod/quiz/report/statistics/simpletest/mdl_question_states.csv
  134. +0 −156 mod/quiz/report/statistics/simpletest/test_qstats.php
  135. +0 −85 mod/quiz/simpletest/testeditlib.php
  136. +0 −78 mod/quiz/simpletest/testlib.php
  137. +0 −154 mod/quiz/simpletest/testlocallib.php
  138. +0 −80 mod/quiz/simpletest/testquizdisplayoptions.php
  139. +0 −82 mod/quiz/simpletest/testquizobj.php
  140. +0 −69 mod/scorm/simpletest/test_formatduration.php
  141. +0 −63 mod/url/simpletest/testlib.php
  142. +0 −5 mod/wiki/simpletest/input/creole/1
  143. +0 −19 mod/wiki/simpletest/input/creole/2
  144. +0 −8 mod/wiki/simpletest/input/creole/3
  145. +0 −10 mod/wiki/simpletest/input/creole/4
  146. +0 −6 mod/wiki/simpletest/input/creole/5
  147. +0 −18 mod/wiki/simpletest/input/creole/6
  148. +0 −4 mod/wiki/simpletest/input/creole/7
  149. +0 −28 mod/wiki/simpletest/input/creole/8
  150. +0 −133 mod/wiki/simpletest/input/creole/9
  151. +0 −20 mod/wiki/simpletest/input/html/1
  152. +0 −7 mod/wiki/simpletest/input/html/2
  153. +0 −20 mod/wiki/simpletest/input/nwiki/1
  154. +0 −23 mod/wiki/simpletest/input/nwiki/2
  155. +0 −22 mod/wiki/simpletest/input/nwiki/3
  156. +0 −13 mod/wiki/simpletest/input/nwiki/4
  157. 0 mod/wiki/simpletest/input/nwiki/5
  158. +0 −3 mod/wiki/simpletest/output/creole/1
  159. +0 −12 mod/wiki/simpletest/output/creole/2
  160. +0 −5 mod/wiki/simpletest/output/creole/3
  161. +0 −6 mod/wiki/simpletest/output/creole/4
  162. +0 −4 mod/wiki/simpletest/output/creole/5
  163. +0 −21 mod/wiki/simpletest/output/creole/6
  164. +0 −3 mod/wiki/simpletest/output/creole/7
  165. +0 −85 mod/wiki/simpletest/output/creole/8
  166. +0 −146 mod/wiki/simpletest/output/creole/9
  167. +0 −20 mod/wiki/simpletest/output/html/1
  168. +0 −7 mod/wiki/simpletest/output/html/2
  169. +0 −11 mod/wiki/simpletest/output/nwiki/1
  170. +0 −12 mod/wiki/simpletest/output/nwiki/2
  171. +0 −39 mod/wiki/simpletest/output/nwiki/3
  172. +0 −26 mod/wiki/simpletest/output/nwiki/4
  173. +0 −1 mod/wiki/simpletest/output/nwiki/5
  174. +0 −86 mod/wiki/simpletest/testwikiparser.php
  175. +0 −318 mod/workshop/allocation/random/simpletest/testallocator.php
  176. +0 −270 mod/workshop/eval/best/simpletest/testlib.php
  177. +0 −230 mod/workshop/form/accumulative/simpletest/testlib.php
  178. +0 −263 mod/workshop/form/numerrors/simpletest/testlib.php
  179. +0 −156 mod/workshop/form/rubric/simpletest/testlib.php
  180. +0 −429 mod/workshop/simpletest/testlocallib.php
  181. +0 −746 question/behaviour/adaptive/simpletest/testwalkthrough.php
  182. +0 −291 question/behaviour/adaptivenopenalty/simpletest/testwalkthrough.php
  183. +0 −272 question/behaviour/deferredcbm/simpletest/testwalkthrough.php
  184. +0 −213 question/behaviour/deferredfeedback/simpletest/testwalkthrough.php
  185. +0 −291 question/behaviour/immediatecbm/simpletest/testwalkthrough.php
  186. +0 −245 question/behaviour/immediatefeedback/simpletest/testwalkthrough.php
  187. +0 −87 question/behaviour/informationitem/simpletest/testwalkthrough.php
  188. +0 −489 question/behaviour/interactive/simpletest/testwalkthrough.php
  189. +0 −148 question/behaviour/interactivecountback/simpletest/testwalkthrough.php
  190. +0 −269 question/behaviour/manualgraded/simpletest/testwalkthrough.php
  191. +0 −108 question/behaviour/missing/simpletest/testmissingbehaviour.php
  192. +0 −757 question/engine/simpletest/helpers.php
  193. +0 −150 question/engine/simpletest/testdatalib.php
  194. +0 −372 question/engine/simpletest/testquestionattempt.php
  195. +0 −116 question/engine/simpletest/testquestionattemptiterator.php
  196. +0 −183 question/engine/simpletest/testquestionattemptstep.php
  197. +0 −135 question/engine/simpletest/testquestionattemptstepiterator.php
  198. +0 −91 question/engine/simpletest/testquestionbank.php
  199. +0 −47 question/engine/simpletest/testquestioncbm.php
  200. +0 −101 question/engine/simpletest/testquestionengine.php
  201. +0 −161 question/engine/simpletest/testquestionstate.php
  202. +0 −223 question/engine/simpletest/testquestionusagebyactivity.php
  203. +0 −193 question/engine/simpletest/testquestionutils.php
  204. +0 −301 question/engine/simpletest/testunitofwork.php
  205. +0 −137 question/engine/upgrade/simpletest/helper.php
  206. +1 −1 question/engine/upgrade/tests/helper.php
  207. 0 question/format/aiken/{simpletest → tests}/fixtures/questions.aiken.txt
  208. +0 −48 question/format/gift/simpletest/fixtures/questions.gift.txt
  209. +0 −886 question/format/gift/simpletest/testgiftformat.php
  210. +0 −1,408 question/format/xml/simpletest/testxmlformat.php
  211. +0 −89 question/simpletest/testimportexport.php
  212. +0 −700 question/type/calculated/db/simpletest/testupgradelibnewqe.php
  213. +0 −156 question/type/calculated/simpletest/helper.php
  214. +0 −150 question/type/calculated/simpletest/testquestion.php
  215. +0 −107 question/type/calculated/simpletest/testquestiontype.php
  216. +0 −117 question/type/calculated/simpletest/testvariablesubstituter.php
  217. +0 −105 question/type/calculated/simpletest/testwalkthrough.php
  218. +0 −802 question/type/calculatedmulti/db/simpletest/testupgradelibnewqe.php
  219. +0 −74 question/type/calculatedmulti/simpletest/helper.php
  220. +0 −111 question/type/calculatedmulti/simpletest/testquestion.php
  221. +0 −105 question/type/calculatedmulti/simpletest/testwalkthrough.php
  222. +0 −637 question/type/calculatedsimple/db/simpletest/testupgradelibnewqe.php
  223. +0 −79 question/type/calculatedsimple/simpletest/helper.php
  224. +0 −111 question/type/calculatedsimple/simpletest/testquestion.php
  225. +0 −104 question/type/calculatedsimple/simpletest/testwalkthrough.php
  226. +0 −460 question/type/description/db/simpletest/testupgradelibnewqe.php
  227. +0 −93 question/type/description/simpletest/helper.php
  228. +0 −68 question/type/description/simpletest/testquestiontype.php
  229. +0 −52 question/type/description/simpletest/testwalkthrough.php
  230. +0 −566 question/type/essay/db/simpletest/testupgradelibnewqe.php
  231. +0 −51 question/type/essay/simpletest/testquestion.php
  232. +0 −74 question/type/essay/simpletest/testquestiontype.php
  233. +0 −787 question/type/match/db/simpletest/testupgradelibnewqe.php
  234. +0 −183 question/type/match/simpletest/testquestion.php
  235. +0 −138 question/type/match/simpletest/testquestiontype.php
  236. +0 −488 question/type/match/simpletest/testwalkthrough.php
  237. +0 −139 question/type/missingtype/simpletest/testmissingtype.php
  238. +0 −2,729 question/type/multianswer/db/simpletest/testupgradelibnewqe.php
  239. +0 −216 question/type/multianswer/simpletest/helper.php
  240. +0 −117 question/type/multianswer/simpletest/testquestion.php
  241. +0 −114 question/type/multianswer/simpletest/testquestiontype.php
  242. +0 −105 question/type/multianswer/simpletest/testwalkthrough.php
  243. +0 −2,769 question/type/multichoice/db/simpletest/testupgradelibnewqe.php
  244. +0 −253 question/type/multichoice/simpletest/testquestion.php
  245. +0 −102 question/type/multichoice/simpletest/testquestiontype.php
  246. +0 −99 question/type/multichoice/simpletest/testwalkthrough.php
  247. +0 −463 question/type/numerical/db/simpletest/testupgradelibnewqe.php
  248. +0 −123 question/type/numerical/simpletest/helper.php
  249. +0 −73 question/type/numerical/simpletest/testanswer.php
  250. +0 −155 question/type/numerical/simpletest/testanswerprocessor.php
  251. +0 −80 question/type/numerical/simpletest/testform.php
  252. +0 −289 question/type/numerical/simpletest/testquestion.php
  253. +0 −123 question/type/numerical/simpletest/testquestiontype.php
  254. +0 −277 question/type/numerical/simpletest/testwalkthrough.php
  255. +0 −985 question/type/random/db/simpletest/testupgradelibnewqe.php
  256. +0 −64 question/type/random/simpletest/testquestiontype.php
  257. +0 −640 question/type/shortanswer/db/simpletest/testupgradelibnewqe.php
  258. +0 −154 question/type/shortanswer/simpletest/helper.php
  259. +0 −198 question/type/shortanswer/simpletest/testquestion.php
  260. +0 −97 question/type/shortanswer/simpletest/testquestiontype.php
  261. +0 −131 question/type/simpletest/testquestionbase.php
  262. +0 −40 question/type/simpletest/testquestiontype.php
  263. +0 −1,164 question/type/truefalse/db/simpletest/testupgradelibnewqe.php
  264. +0 −90 question/type/truefalse/simpletest/helper.php
  265. +0 −109 question/type/truefalse/simpletest/testquestion.php
  266. +0 −77 question/type/truefalse/simpletest/testquestiontype.php
  267. +0 −74 question/type/truefalse/simpletest/testwalkthrough.php
  268. +0 −278 rating/simpletest/testrating.php
  269. +0 −1,693 webservice/simpletest/testwebservice.php
@@ -1,169 +0,0 @@
-<?php
-// This file is part of Moodle - http://moodle.org/
-//
-// Moodle is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// Moodle is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
-
-/**
- * Run database functional tests.
- *
- * @package tool
- * @subpackage unittest
- * @copyright 2008 Petr Skoda {@link http://skodak.org}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-define('NO_OUTPUT_BUFFERING', true);
-
-require(dirname(__FILE__) . '/../../../config.php');
-require_once($CFG->libdir.'/adminlib.php');
-
-require_once('simpletestlib.php');
-require_once('simpletestcoveragelib.php');
-require_once('ex_simple_test.php');
-require_once('ex_reporter.php');
-
-$showpasses = optional_param('showpasses', false, PARAM_BOOL);
-$codecoverage = optional_param('codecoverage', false, PARAM_BOOL);
-$selected = optional_param_array('selected', array(), PARAM_INT);
-
-// Print the header and check access.
-admin_externalpage_setup('tooldbtest');
-echo $OUTPUT->header();
-
-global $UNITTEST;
-$UNITTEST = new stdClass();
-
-if (!data_submitted()) {
- $selected = array();
- for ($i=0; $i<=10; $i++) {
- $selected[$i] = 1;
- }
-}
-
-
-$dbinfos = array();
-$tests = array();
-
-$dbinfos[0] = array('name'=>"Current database ($CFG->dblibrary/$CFG->dbtype)", 'installed'=>true, 'configured'=>true); // TODO: localise
-if (data_submitted() and !empty($selected[0])) {
- $tests[0] = $DB;
-}
-
-for ($i=1; $i<=10; $i++) {
- $name = 'func_test_db_'.$i;
- if (!isset($CFG->$name)) {
- continue;
- }
- list($library, $driver, $dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions) = $CFG->$name;
- $dbinfos[$i] = array('name'=>"External database $i ($library/$driver/$dbhost/$dbname/$prefix)", 'installed'=>false, 'configured'=>false);
-
- $classname = "{$driver}_{$library}_moodle_database";
- require_once("$CFG->libdir/dml/$classname.php");
- $d = new $classname();
- if (!$d->driver_installed()) {
- continue;
- }
- $dbinfos[$i]['installed'] = true;
-
- try {
- $d->connect($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions);
- $dbinfos[$i]['configured'] = true;
- if (data_submitted() and !empty($selected[$i])) {
- $tests[$i] = $d;
- } else {
- $d->dispose();
- }
- } catch (dml_connection_exception $e) {
- $dbinfos[$i]['configured'] = false;
- }
-}
-
-if (!empty($tests)) {
- $covreporter = new moodle_coverage_reporter('Functional DB Tests Code Coverage Report', 'dbtest');
- $covrecorder = new moodle_coverage_recorder($covreporter);
-
- foreach ($tests as $i=>$database) {
- $dbinfo = $dbinfos[$i];
-
- $UNITTEST->func_test_db = $database; // pass the db to the tests through global
-
- echo $OUTPUT->heading('Running tests on: '.$dbinfo['name'], 3); // TODO: localise
-
- // Create the group of tests.
- $test = new autogroup_test_coverage(false, true, $codecoverage);
-
-
- $test->addTestFile($CFG->libdir.'/dml/simpletest/testdml.php');
- $test->addTestFile($CFG->libdir.'/ddl/simpletest/testddl.php');
-
- // Make the reporter, which is what displays the results.
- $reporter = new ExHtmlReporter($showpasses);
-
- set_time_limit(300); // 5 mins per DB should be enough
- $test->run_with_external_coverage($reporter, $covrecorder);
-
- unset($UNITTEST->func_test_db);
-
- echo '<hr />';
- }
- if ($codecoverage) {
- $covrecorder->generate_report();
- moodle_coverage_reporter::print_summary_info('dbtest');
- }
-
-}
-
-// Print the form for adjusting options.
-echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
-echo '<form method="post" action="dbtest.php">';
-echo '<div>';
-echo $OUTPUT->heading("Run functional database tests"); // TODO: localise
-echo '<p>'.html_writer::checkbox('showpasses', 1, $showpasses, get_string('showpasses', 'tool_unittest')).'</p>';
-if (moodle_coverage_recorder::can_run_codecoverage()) {
- echo '<p>'.html_writer::checkbox('codecoverage', 1, $codecoverage, get_string('codecoverageanalysis', 'tool_unittest')).'</p>';
-} else {
- echo '<p>'; print_string('codecoveragedisabled', 'tool_unittest'); echo '<input type="hidden" name="codecoverage" value="0" /></p>';
-}
-echo '<p><strong>'."Databases:".'</strong></p>';
-echo '<ul>';
-foreach ($dbinfos as $i=>$dbinfo) {
- $name = $dbinfo['name'];
- if ($dbinfo['installed']) {
- if (!$dbinfo['configured']) {
- $name = "$name (misconfigured)"; // TODO: localise
- }
- echo '<li>'.html_writer::checkbox('selected['.$i.']', 1, intval(!empty($selected[$i])), $name).'</li>';
- } else {
- echo '<li>'."$name: driver not installed".'</li>'; // TODO: localise
- }
-}
-echo '</ul>';
-echo '<p>External databases are configured in config.php, add lines:</p>
-<pre>
-$CFG->func_test_db_1 = array("native", "pgsql", "localhost", "moodleuser", "password", "moodle", "test", null);
-$CFG->func_test_db_2 = array("native", "mssql", "localhost", "moodleuser", "password", "moodle", "test", null);
-</pre>
-<p>where order of parameters is: dblibrary, dbtype, dbhost, dbuser, dbpass, dbname, prefix, dboptions</p>';
-echo '<p><input type="submit" value="' . get_string('runtests', 'tool_unittest') . '" /></p>';
-echo '</div>';
-echo '</form>';
-echo $OUTPUT->box_end();
-
-// Print link to latest code coverage for this report type
-if (!data_submitted() || !$codecoverage) {
- moodle_coverage_reporter::print_link_to_latest('dbtest');
-}
-
-// Footer.
-echo $OUTPUT->footer();
@@ -141,26 +141,6 @@
echo '</form>';
echo $OUTPUT->box_end();
-$otherpages = array();
-$otherpages['PDF lib test'] = new moodle_url('/admin/tool/unittest/other/pdflibtestpage.php');
-if (debugging('', DEBUG_DEVELOPER)) {
- $otherpages['TODO checker'] = new moodle_url('/admin/tool/unittest/other/todochecker.php');
-}
-
-// print list of extra test pages that are not simpletests,
-// not everything there is good enough to show to our users
-if ($otherpages) {
- echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
- echo $OUTPUT->heading(get_string('othertestpages', 'tool_unittest'));
- echo '<ul>';
- foreach ($otherpages as $name=>$url) {
- echo '<li>'.html_writer::link($url, $name).'</li>';
- }
- echo '</ul>';
- echo $OUTPUT->box_end();
-}
-
-
// Print link to latest code coverage for this report type
if (is_null($path) || !$codecoverage) {
moodle_coverage_reporter::print_link_to_latest('unittest');
@@ -1,94 +0,0 @@
-<?php
-
-die;die;die;
-/*
- if (empty($CFG->unittestprefix)) {
- die;
- }
-
- $CFG->xmlstrictheaders = false;
-
- // extra security
- session_write_close();
-
- $return_url = "$CFG->wwwroot/$CFG->admin/tool/unittest/test_tables.php";
-
- // Temporarily override $DB and $CFG for a fresh install on the unit test prefix
-
- $real_cfg = $CFG;
-
- $CFG = new stdClass();
- $CFG->dbhost = $real_cfg->dbhost;
- $CFG->dbtype = $real_cfg->dbtype;
- $CFG->dblibrary = $real_cfg->dblibrary;
- $CFG->dbuser = $real_cfg->dbuser;
- $CFG->dbpass = $real_cfg->dbpass;
- $CFG->dbname = $real_cfg->dbname;
- $CFG->unittestprefix = $real_cfg->unittestprefix;
- $CFG->wwwroot = $real_cfg->wwwroot;
- $CFG->dirroot = $real_cfg->dirroot;
- $CFG->libdir = $real_cfg->libdir;
- $CFG->dataroot = $real_cfg->dataroot;
- $CFG->admin = $real_cfg->admin;
- $CFG->release = $real_cfg->release;
- $CFG->version = $real_cfg->version;
- $CFG->config_php_settings = $real_cfg->config_php_settings;
- $CFG->debug = 0;
-
- $DB = moodle_database::get_driver_instance($CFG->dbtype, $CFG->dblibrary);
- $DB->connect($CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->unittestprefix);
-
- $test_tables = $DB->get_tables();
-
- include("$CFG->dirroot/version.php"); // defines $version and $release
-
- /// Check if the main tables have been installed yet or not.
- if ($test_tables = $DB->get_tables() ) { // No tables yet at all.
- //TODO: make sure these are test tables & delte all these tables
- $manager = $DB->get_manager();
- foreach ($test_tables as $table) {
- $xmldbtable = new xmldb_table($table);
- $manager->drop_table($xmldbtable);
- }
- }
-
-/// return to original debugging level
-
- $DB->get_manager()->install_from_xmldb_file("$CFG->libdir/db/install.xml");
-
-/// set all core default records and default settings
- require_once("$CFG->libdir/db/install.php");
- xmldb_main_install($version);
-
-/// Continue with the instalation
-
- // Install the roles system.
- moodle_install_roles();
-
- // Install core event handlers
- events_update_definition();
-
- // Install core message providers
- message_update_providers();
- message_update_providers('message');
-
- // Write default settings unconditionally (i.e. even if a setting is already set, overwrite it)
- admin_apply_default_settings(NULL, true);
-
-
-/// upgrade all plugins types
- $plugintypes = get_plugin_types();
- foreach ($plugintypes as $type => $location) {
- upgrade_plugins($type);
- }
-
-/// just make sure upgrade logging is properly terminated
- upgrade_finished();
-
-/// make sure admin user is created - this is the last step because we need
-/// session to be working properly in order to edit admin account
- create_admin_user();
-
-
- redirect('index.php');
-*/
@@ -26,5 +26,4 @@
defined('MOODLE_INTERNAL') || die;
-$ADMIN->add('development', new admin_externalpage('toolsimpletest', get_string('pluginname', 'tool_unittest'), "$CFG->wwwroot/$CFG->admin/tool/unittest/index.php", 'tool/unittest:execute'));
-$ADMIN->add('development', new admin_externalpage('tooldbtest', get_string('dbtest', 'tool_unittest'), "$CFG->wwwroot/$CFG->admin/tool/unittest/dbtest.php", 'tool/unittest:execute'));
+$ADMIN->add('development', new admin_externalpage('toolsimpletest', get_string('pluginname', 'tool_unittest'), "$CFG->wwwroot/$CFG->admin/tool/unittest/index.php", 'tool/unittest:execute', true));
Oops, something went wrong.

0 comments on commit f488088

Please sign in to comment.