summaryrefslogtreecommitdiffstats
path: root/tests/lib/appconfig.php
diff options
context:
space:
mode:
authorkondou <kondou@ts.unde.re>2013-08-06 17:30:58 +0200
committerkondou <kondou@ts.unde.re>2013-08-06 17:30:58 +0200
commitd70a4a960da243a490c9b3211fb91f59864f5ba5 (patch)
tree675a9cef652eabb6ee9229c2597ac557451c13d7 /tests/lib/appconfig.php
parent56549dafce474d74f32d33f6bf510ec7514283e1 (diff)
downloadnextcloud-server-d70a4a960da243a490c9b3211fb91f59864f5ba5.tar.gz
nextcloud-server-d70a4a960da243a490c9b3211fb91f59864f5ba5.zip
Use setUpBeforeClass() and tearDownAfterClass()
Diffstat (limited to 'tests/lib/appconfig.php')
-rw-r--r--tests/lib/appconfig.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/lib/appconfig.php b/tests/lib/appconfig.php
index c73e528a277..4d82cd5ba7b 100644
--- a/tests/lib/appconfig.php
+++ b/tests/lib/appconfig.php
@@ -7,7 +7,7 @@
*/
class Test_Appconfig extends PHPUnit_Framework_TestCase {
- private function fillDb() {
+ public static function setUpBeforeClass() {
$query = \OC_DB::prepare('INSERT INTO `*PREFIX*appconfig` VALUES (?, ?, ?)');
$query->execute(array('testapp', 'enabled', 'true'));
@@ -26,9 +26,15 @@ class Test_Appconfig extends PHPUnit_Framework_TestCase {
$query->execute(array('anotherapp', 'enabled', 'false'));
}
- public function testGetApps() {
- $this->fillDb();
+ public static function tearDownAfterClass() {
+ $query = \OC_DB::prepare('DELETE FROM `*PREFIX*appconfig` WHERE `appid` = ?');
+ $query->execute(array('testapp'));
+ $query->execute(array('someapp'));
+ $query->execute(array('123456'));
+ $query->execute(array('anotherapp'));
+ }
+ public function testGetApps() {
$query = \OC_DB::prepare('SELECT DISTINCT `appid` FROM `*PREFIX*appconfig`');
$result = $query->execute();
$expected = array();