diff options
author | kondou <kondou@ts.unde.re> | 2013-08-06 17:01:01 +0200 |
---|---|---|
committer | kondou <kondou@ts.unde.re> | 2013-08-06 17:01:01 +0200 |
commit | b560bb21f092c9d93172e53559db7df7bbfd8f1d (patch) | |
tree | 2b97bda2605c73902cc6cafa95d5491284783a6b /tests | |
parent | 057d7aa108f9b24c12b97f5f78008eb17a6d3bee (diff) | |
download | nextcloud-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.php | 9 |
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(); } } |