Commit b560bb21 authored by kondou's avatar kondou
Browse files

Clean up DB, after we're done with testing

parent 057d7aa1
......@@ -28,6 +28,13 @@ class Test_Preferences extends PHPUnit_Framework_TestCase {
$query->execute(array("Deleteuser", "someapp", "somekey", "somevalue"));
}
private function cleanDb() {
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*preferences` WHERE `user` = ?');
$query->execute(array('Someuser'));
$query->execute(array('Anotheruser'));
$query->execute(array('Anuser'));
}
public function testGetUsers() {
$this->fillDb();
......@@ -117,5 +124,7 @@ class Test_Preferences extends PHPUnit_Framework_TestCase {
$query = \OC_DB::prepare('SELECT `configvalue` FROM `*PREFIX*preferences` WHERE `appid` = ?');
$result = $query->execute(array('someapp'));
$this->assertEquals(0, $result->numRows());
$this->cleanDb();
}
}
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