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
(DDL tests)
No edit summary
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Work in progress}}
{{Template:Development:dmllib 2.0}}{{Moodle_2.0}}
{{Template:Development:dmllib 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:
<code php>
$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);
</code>


== DDL tests ==
== DDL tests ==
Based on tests already used in xmldb, the following have been implemented in simpletest:
All DDL test must pass on any production server.
 
== DML tests ==
Ideally all DML tests should pass on production servers.


* TestCreateTable
Common problems:
* TestDropTable
* MySQL MyISAM engine does ACID compliant and does not support transactions, please consider upgrading to InnoDB.
* TestAddEnumField
* MySQL supports only a limited number of collations, this may cause significant problems for non-english languages
* TestAddNumericField
* Oracle is known to fail in multiple tests (work in progress)
* TestDropField
* TestChangeFieldType
* TestChangeFieldPrecision
* TestChangeFieldSign
* TestChangeFieldNullability
* TestChangeFieldDefault
* TestAddUniqueIndex
* TestAddNonUniqueIndex
* TestFindIndexName
* TestDropIndex
* TestAddUniqueKey
* TestAddForeignUniqueKey
* TestDropKey
* TestAddForeignKey
* TestDropForeignKey
* TestChangeFieldEnum
* TestRenameIndex
* TestRenameKey '''Experimental'''
* TestRenameField '''Experimental'''
* TestRenameTable

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)