Clean up database before setup the database for testing

This commit is contained in:
Morris Jobke 2014-02-27 13:27:24 +01:00
parent ec54bc7709
commit 4bb303cbd6
1 changed files with 4 additions and 0 deletions

View File

@ -26,6 +26,10 @@
class Test_Files_Sharing_Updater extends \PHPUnit_Framework_TestCase { class Test_Files_Sharing_Updater extends \PHPUnit_Framework_TestCase {
function setUp() { function setUp() {
// some previous tests didn't clean up and therefore this has to be done here
// FIXME: DIRTY HACK - TODO: find tests, that don't clean up and fix it there
$this->tearDown();
$addShares = \OC_DB::prepare('INSERT INTO `*PREFIX*share` (file_source, id, item_type, uid_owner) VALUES (?, ?, \'file\', 1)'); $addShares = \OC_DB::prepare('INSERT INTO `*PREFIX*share` (file_source, id, item_type, uid_owner) VALUES (?, ?, \'file\', 1)');
$shares = array(1, 2, 3); $shares = array(1, 2, 3);
foreach($shares as $share) { foreach($shares as $share) {