27 Commits

Author SHA1 Message Date
Sam Marshall
cf617be64e Unit tests MDL-24909 Unit tests used 5 minute time limit per test class; this is insufficient for gradebook tests on slow server. Changed to use 60 second limit per test function instead. Added constant and comment defining this behaviour. 2010-11-01 15:14:37 +00:00
Jonathan Harker
9f24170cb8 MDL-20876 - updating third-party library readme_moodle with changes.
Author: Jonathan Harker <jonathan@catalyst.net.nz>
2010-07-21 01:25:04 +00:00
Jonathan Harker
bed733c237 lib: MDL-20876 third-party libs - fix deprecated split() calls.
Author: Jonathan Harker <jonathan@catalyst.net.nz>
2010-07-20 01:29:36 +00:00
Petr Skoda
9c67fd9107 fixed comment typo 2010-07-19 08:54:18 +00:00
Petr Skoda
0a8f8a65cd MDL-19698 deprecated assign new by ref in simpletest lib 2010-07-19 08:53:16 +00:00
Tim Hunt
39321e0faf unit tests: MDL-22175 Further improvements unit test failure display.
Exceptions are now also shown with a pruned stack trace.
And 2.0 code for displaying PHP5 error types backported to 1.9.
2010-04-23 17:22:55 +00:00
Eloy Lafuente
2319bdedd6 MDL-21007 UnitTestCaseUsingDatabase misconfigured unit tests now reported as skipped 2009-11-30 23:18:34 +00:00
Eloy Lafuente
776b85474d MDL-21007 FakeDBUnitTestCase unit tests now reported as exceptions 2009-11-30 21:36:28 +00:00
tjhunt
0c49b68d59 Try to avoid time-outs while running the unit tests 2009-06-22 06:59:13 +00:00
skodak
80cfaf2bfe MDL-19471 fixed PHP 5.3 compatibility 2009-06-11 19:20:03 +00:00
fmarier
316914bf6e MDL-17037 ran all GIF images through gifsicle and PNG through optipng 2009-04-05 23:33:00 +00:00
tjhunt
f68cb08bbe unit tests: MDL-18607 new way to do unit tests involving the database.
This is not as ambitious as the abortive FakeDBUnitTests scheme, but this one works for simple cases.

There is a new test case class UnitTestCaseUsingDatabase to inherit from. I hope it is sufficiently well documented in its PHPdocs.
* It users $CFG->unittestprefix.
* You can access that database using $this->testdb.
* That database is empty by default, you have to call create_test_table to create the ones you want, and drop_test_table to clean them up in the end. The table definitions are read from the XMLDB file.
* When you are ready to call real Moodle code that users $DB, call switch_to_test_db and then revert_to_real_db when you are done.
* If you forget to call drop_test_table or switch_to_test_db, the class will attempt to clean up after you, but will also print rude developer debug messages telling you not to be stupid.
* There is also a load_test_data method for populating a table from an array.

The is an example of its use in lib/simpletest/testunittestusingdb.php.
2009-03-23 04:12:37 +00:00
skodak
84ebf08dcc MDL-16483 $CFG->unittestprefix not required anymore to run unit tests that do not need fake db; it should be saer to let admins modify the prefix in config.php instead of modifying it from php 2009-01-10 16:06:53 +00:00
skodak
8716a5e5f6 MDL-17803 grrrrrrrr - there were two moodle readme files! 2009-01-10 11:17:42 +00:00
skodak
6527149a61 added details of our simpletest lib modification 2009-01-10 11:14:59 +00:00
tjhunt
a7b7f075df unit tests: MDL-17803 test classes were not getting destroyed at the right time, which was breaking the code that reset the test DB to the normal DB. 2009-01-07 08:58:41 +00:00
skodak
995821591d MDL-17534 simpletest: temporary fix for exception problems 2008-12-04 23:19:37 +00:00
nicolasconnault
0ad7d5af3f MDL-15204 Removing the lib/simpletestlib/simpletest folder, which was a mistake 2008-07-24 09:27:06 +00:00
nicolasconnault
ea2fdf56ce MDL-15204 Added new files 2008-06-12 09:13:38 +00:00
nicolasconnault
f80efd77e7 MDL-15204 Update complete 2008-06-10 20:10:50 +00:00
nicolasconnault
f34488b2e6 MDL-15102 Upgrade to DMLLIB 2.0. Needs further testing and bug-fixing. 2008-06-06 14:43:15 +00:00
nicolasconnault
4fc9ec1ec0 Managed to remove static calls from the core gradebook classes without removing support for such calls in gradebook interface code. I used a singleton pattern for this (get_instance in grade_object). 2007-11-13 07:36:00 +00:00
skodak
cdbbd26f80 MDL-10064 global $CFG in unit test files is non standard, it is recommended to use MOODLE_INTERNAL test in all library files 2007-06-09 16:32:36 +00:00
skodak
02e6a9731f MDL-9866 reverting previous incorrect fix for include() in simpletest library; patching grade unit tests instead 2007-06-09 15:03:05 +00:00
skodak
97c13bd803 MDL-9866 incorrect include() in simpletest library 2007-05-21 14:27:22 +00:00
nicolasconnault
85414e846a Upgraded simpletestlib from 1.0.1alpha3 to 1.0.1beta 2007-04-26 07:11:44 +00:00
tjhunt
3ef8c9362d Bug #5979 - Check in the OU's unit testing framework. Docs at http://docs.moodle.org/en/Unit_tests 2006-06-30 14:59:05 +00:00