summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorkondou <kondou@ts.unde.re>2013-08-06 17:26:12 +0200
committerkondou <kondou@ts.unde.re>2013-08-06 17:26:12 +0200
commitb8bfebe51e6d4c007a6dcd3fcb56e4684704af24 (patch)
tree42b1ebbc3de5dac6ff86d3d2d98d4f240c97a224 /tests
parentb560bb21f092c9d93172e53559db7df7bbfd8f1d (diff)
downloadnextcloud-server-b8bfebe51e6d4c007a6dcd3fcb56e4684704af24.tar.gz
nextcloud-server-b8bfebe51e6d4c007a6dcd3fcb56e4684704af24.zip
Use setUpBeforeClass() and tearDownAfterClass()
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/preferences.php8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/lib/preferences.php b/tests/lib/preferences.php
index a1719c92b29..18e1cde8488 100644
--- a/tests/lib/preferences.php
+++ b/tests/lib/preferences.php
@@ -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,7 +28,7 @@ class Test_Preferences extends PHPUnit_Framework_TestCase {
$query->execute(array("Deleteuser", "someapp", "somekey", "somevalue"));
}
- private function cleanDb() {
+ public static function tearDownAfterClass() {
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*preferences` WHERE `user` = ?');
$query->execute(array('Someuser'));
$query->execute(array('Anotheruser'));
@@ -36,8 +36,6 @@ class Test_Preferences extends PHPUnit_Framework_TestCase {
}
public function testGetUsers() {
- $this->fillDb();
-
$query = \OC_DB::prepare('SELECT DISTINCT `userid` FROM `*PREFIX*preferences`');
$result = $query->execute();
$expected = array();
@@ -124,7 +122,5 @@ 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();
}
}