]> source.dussan.org Git - nextcloud-server.git/commitdiff
Clean up DB, after we're done with testing
authorkondou <kondou@ts.unde.re>
Tue, 6 Aug 2013 15:01:01 +0000 (17:01 +0200)
committerkondou <kondou@ts.unde.re>
Tue, 6 Aug 2013 15:01:01 +0000 (17:01 +0200)
tests/lib/preferences.php

index d39555aa01d89c2f08780f59aadfa9ce906c2449..a1719c92b2963460295561b736b04bd44e99c292 100644 (file)
@@ -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();
        }
 }