aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/AppConfigTest.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-10-20 15:11:01 +0200
committerJoas Schilling <coding@schilljs.com>2016-10-20 15:19:41 +0200
commit122edcd0c1b652f25c36c52cc7541eb62695bf37 (patch)
treeb9fa6b1f1a4229aa63ea33bda790747a1933eb02 /tests/lib/AppConfigTest.php
parentb946e3ecfb2478f7aaca82c11367a2be8455a2d0 (diff)
downloadnextcloud-server-122edcd0c1b652f25c36c52cc7541eb62695bf37.tar.gz
nextcloud-server-122edcd0c1b652f25c36c52cc7541eb62695bf37.zip
Make sure all tests use the TestCase method to overwrite services
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/lib/AppConfigTest.php')
-rw-r--r--tests/lib/AppConfigTest.php15
1 files changed, 2 insertions, 13 deletions
diff --git a/tests/lib/AppConfigTest.php b/tests/lib/AppConfigTest.php
index 520dbf66d36..c4da7507752 100644
--- a/tests/lib/AppConfigTest.php
+++ b/tests/lib/AppConfigTest.php
@@ -40,7 +40,7 @@ class AppConfigTest extends TestCase {
$sql->delete('appconfig');
$sql->execute();
- $this->registerAppConfig(new \OC\AppConfig($this->connection));
+ $this->overwriteService('AppConfig', new \OC\AppConfig($this->connection));
$sql = $this->connection->getQueryBuilder();
$sql->insert('appconfig')
@@ -130,21 +130,10 @@ class AppConfigTest extends TestCase {
$sql->execute();
}
- $this->registerAppConfig(new \OC\AppConfig(\OC::$server->getDatabaseConnection()));
+ $this->restoreService('AppConfig');
parent::tearDown();
}
- /**
- * Register an app config object for testing purposes.
- *
- * @param \OCP\IAppConfig $appConfig
- */
- protected function registerAppConfig($appConfig) {
- \OC::$server->registerService('AppConfig', function () use ($appConfig) {
- return $appConfig;
- });
- }
-
public function testGetApps() {
$config = new \OC\AppConfig(\OC::$server->getDatabaseConnection());