moodle/admin/report
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
..
backups MDL-12037 Backup Log - add new field to backup_log table to allow other backup related functions to save log data 2009-03-03 00:06:08 +00:00
capability MDL-17758 fixed hardcoded /admin/ links 2009-01-01 14:25:29 +00:00
configlog MDL-17878 basic UI for looking at config log 2009-01-13 21:13:16 +00:00
courseoverview "MDL-14129, remove the rest error() in moodle2" 2008-12-12 04:53:32 +00:00
log MDL-17465 - separate live log capability adn admin tree link 2008-11-29 16:15:40 +00:00
questioninstances MDL-17463 - reparate capabilities for course and admin reports 2008-11-29 14:22:10 +00:00
security MDL-18039 fixed footer docs link 2009-02-19 07:32:23 +00:00
spamcleaner MDL-18223 removed repeated format_text() - should be applied only once 2009-02-17 23:01:30 +00:00
stats MDL-17463 - reparate capabilities for course and admin reports 2008-11-29 14:22:10 +00:00
unittest unit tests: MDL-18607 new way to do unit tests involving the database. 2009-03-23 04:12:37 +00:00