Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

DB layer 2.0 functional testing: Difference between revisions

From MoodleDocs
No edit summary
No edit summary
Line 1: Line 1:
{{{Template:Development:dmllib 2.0}}{{Moodle_2.0}}
{{Template:Development:dmllib 2.0}}{{Moodle_2.0}}


Functional unit tests can be used to test the interaction of Moodle and database, it is testing following:
Functional unit tests can be used to test the interaction of Moodle and database, it is testing following:

Revision as of 18:45, 3 September 2010

Moodle 2.0


Functional unit tests can be used to test the interaction of Moodle and database, it is testing following:

  • SQL database server
  • PHP database driver
  • Moodle DB connection settings, driver configuration and server settings
  • Moodle DDL generator
  • Moodle DML driver

You can test current database specified in config.php, you can also specify other DB servers via following config.php settings, for example: $CFG->func_test_db_1 = array("native", "mysqli", "localhost", "root", "yourpassword", "moodle", "tst_", array('dbengine'=>'InnoDB')); $CFG->func_test_db_2 = array("native", "mysqli", "localhost", "root", "yourpassword", "moodle2", "tst_", array('dbengine'=>'MyISAM')); $CFG->func_test_db_3 = array("native", "pgsql", "localhost", "moodleuser", "yourpassword", "moodle2", "tst_", NULL); $CFG->func_test_db_4 = array("native", "mssql", "192.168.15.41", "sa", "yourpassword", "moodle", "tst_", NULL);

DDL tests

All DDL test must pass on any production server.

DML tests

Ideally all DML tests should pass on production servers.

Common problems:

  • MySQL MyISAM engine does ACID compliant and does not support transactions, please consider upgrading to InnoDB.
  • MySQL supports only a limited number of collations, this may cause significant problems for non-english languages
  • Oracle is known to fail in multiple tests (work in progress)