Skip to content
Snippets Groups Projects
Commit 35e1d8b2 authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge pull request #4328 from owncloud/cleanupdb_kondou

Clean up DB, after we're done with testing Preferences
parents f7915d74 6c781525
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
*/
class Test_Preferences extends PHPUnit_Framework_TestCase {
private function fillDb() {
public static function setUpBeforeClass() {
$query = \OC_DB::prepare('INSERT INTO `*PREFIX*preferences` VALUES(?, ?, ?, ?)');
$query->execute(array("Someuser", "someapp", "somekey", "somevalue"));
......@@ -28,9 +28,14 @@ class Test_Preferences extends PHPUnit_Framework_TestCase {
$query->execute(array("Deleteuser", "someapp", "somekey", "somevalue"));
}
public function testGetUsers() {
$this->fillDb();
public static function tearDownAfterClass() {
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*preferences` WHERE `userid` = ?');
$query->execute(array('Someuser'));
$query->execute(array('Anotheruser'));
$query->execute(array('Anuser'));
}
public function testGetUsers() {
$query = \OC_DB::prepare('SELECT DISTINCT `userid` FROM `*PREFIX*preferences`');
$result = $query->execute();
$expected = array();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment