summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorkondou <kondou@ts.unde.re>2013-08-06 17:01:01 +0200
committerkondou <kondou@ts.unde.re>2013-08-06 17:01:01 +0200
commitb560bb21f092c9d93172e53559db7df7bbfd8f1d (patch)
tree2b97bda2605c73902cc6cafa95d5491284783a6b /tests
parent057d7aa108f9b24c12b97f5f78008eb17a6d3bee (diff)
downloadnextcloud-server-b560bb21f092c9d93172e53559db7df7bbfd8f1d.tar.gz
nextcloud-server-b560bb21f092c9d93172e53559db7df7bbfd8f1d.zip
Clean up DB, after we're done with testing
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/preferences.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/lib/preferences.php b/tests/lib/preferences.php
index d39555aa01d..a1719c92b29 100644
--- a/tests/lib/preferences.php
+++ b/tests/lib/preferences.php
@@ -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();
}
}