Commit 0314d681 authored by Andrew Robert Nicols's avatar Andrew Robert Nicols
Browse files

Fix issues with mysql unit testing (Bug #819396)



Change-Id: I6693636c0847e485e0e06949e618f62aa8edc4b7
Signed-off-by: default avatarAndrew Robert Nicols <andrew.nicols@luns.net.uk>
parent 009ad5c3
......@@ -194,6 +194,21 @@ class MaharaUnitTest extends PHPUnit_Framework_TestCase {
/** required user data for creating users **/
private static $userdata = array('username', 'email', 'firstname', 'lastname');
/**
* Superclass setUp method
*
* Takes care of setting up the database correctly as this doesn't
* happen in unit test through init.php properly.
*
* parent::setUp() must always be called if it is overriden in
* subclasses
*
* @return void
*/
protected function setUp() {
configure_dbconnection();
}
/**
* require a user to be created in order for the tests to run
*
......
......@@ -55,6 +55,7 @@ class ViewTest extends MaharaUnitTest {
* create a view to test with
*/
public function setUp() {
parent::setUp();
$this->require_test_user();
// set the owner of the view to the test user we created
$this->fields['owner'] = array($this->users['test'], $this->users['test']);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment