Index: lib/simpletest/portfolio_testclass.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/simpletest/portfolio_testclass.php,v retrieving revision 1.18 diff -u -r1.18 portfolio_testclass.php --- lib/simpletest/portfolio_testclass.php 1 Nov 2010 18:00:57 -0000 1.18 +++ lib/simpletest/portfolio_testclass.php 8 Nov 2010 16:46:50 -0000 @@ -195,10 +195,21 @@ class portfoliolib_test extends UnitTestCaseUsingDatabase { private $olduser; + protected $testtables = array( + 'lib' => array( + 'portfolio_instance', 'portfolio_instance_user', 'portfolio_instance_config', + 'user', 'course', 'course_categories')); + function setup() { global $USER; parent::setup(); + + $this->switch_to_test_db(); // Switch to test DB for all the execution + foreach ($this->testtables as $dir => $tables) { + $this->create_test_tables($tables, $dir); // Create tables + } + // It is necessary to store $USER object because some subclasses use generator // stuff which breaks $USER $this->olduser = $USER;