summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-03-17 16:37:48 -0600
committerMorris Jobke <hey@morrisjobke.de>2017-03-19 15:53:49 -0600
commitedd55b0ea9c13273695bf95d913f4dfc03e08c95 (patch)
tree71bcb99c0d2b5fd16d97eadcc947e11488c23817 /tests
parentc02527e41462133444881817b741f91ebf563b3b (diff)
downloadnextcloud-server-edd55b0ea9c13273695bf95d913f4dfc03e08c95.tar.gz
nextcloud-server-edd55b0ea9c13273695bf95d913f4dfc03e08c95.zip
Use SystemConfig instead of AllConfig for DB stuff
* preparation for followup PRs to clean up the DB bootstrapping Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/SetupTest.php14
-rw-r--r--tests/lib/UtilCheckServerTest.php6
2 files changed, 10 insertions, 10 deletions
diff --git a/tests/lib/SetupTest.php b/tests/lib/SetupTest.php
index acbce938a25..d0e38cf407f 100644
--- a/tests/lib/SetupTest.php
+++ b/tests/lib/SetupTest.php
@@ -9,14 +9,14 @@
namespace Test;
use bantu\IniGetWrapper\IniGetWrapper;
-use OCP\IConfig;
+use OC\SystemConfig;
use OCP\IL10N;
use OCP\ILogger;
use OCP\Security\ISecureRandom;
class SetupTest extends \Test\TestCase {
- /** @var IConfig | \PHPUnit_Framework_MockObject_MockObject */
+ /** @var SystemConfig | \PHPUnit_Framework_MockObject_MockObject */
protected $config;
/** @var \bantu\IniGetWrapper\IniGetWrapper | \PHPUnit_Framework_MockObject_MockObject */
private $iniWrapper;
@@ -34,7 +34,7 @@ class SetupTest extends \Test\TestCase {
protected function setUp() {
parent::setUp();
- $this->config = $this->createMock(IConfig::class);
+ $this->config = $this->createMock(SystemConfig::class);
$this->iniWrapper = $this->createMock(IniGetWrapper::class);
$this->l10n = $this->createMock(IL10N::class);
$this->defaults = $this->createMock(\OC_Defaults::class);
@@ -49,7 +49,7 @@ class SetupTest extends \Test\TestCase {
public function testGetSupportedDatabasesWithOneWorking() {
$this->config
->expects($this->once())
- ->method('getSystemValue')
+ ->method('getValue')
->will($this->returnValue(
array('sqlite', 'mysql', 'oci')
));
@@ -72,7 +72,7 @@ class SetupTest extends \Test\TestCase {
public function testGetSupportedDatabasesWithNoWorking() {
$this->config
->expects($this->once())
- ->method('getSystemValue')
+ ->method('getValue')
->will($this->returnValue(
array('sqlite', 'mysql', 'oci', 'pgsql')
));
@@ -92,7 +92,7 @@ class SetupTest extends \Test\TestCase {
public function testGetSupportedDatabasesWithAllWorking() {
$this->config
->expects($this->once())
- ->method('getSystemValue')
+ ->method('getValue')
->will($this->returnValue(
array('sqlite', 'mysql', 'pgsql', 'oci')
));
@@ -121,7 +121,7 @@ class SetupTest extends \Test\TestCase {
public function testGetSupportedDatabaseException() {
$this->config
->expects($this->once())
- ->method('getSystemValue')
+ ->method('getValue')
->will($this->returnValue('NotAnArray'));
$this->setupClass->getSupportedDatabases();
}
diff --git a/tests/lib/UtilCheckServerTest.php b/tests/lib/UtilCheckServerTest.php
index b1152e97256..c597a6b770b 100644
--- a/tests/lib/UtilCheckServerTest.php
+++ b/tests/lib/UtilCheckServerTest.php
@@ -19,17 +19,17 @@ class UtilCheckServerTest extends \Test\TestCase {
/**
* @param array $systemOptions
- * @return \OCP\IConfig | \PHPUnit_Framework_MockObject_MockObject
+ * @return \OC\SystemConfig | \PHPUnit_Framework_MockObject_MockObject
*/
protected function getConfig($systemOptions) {
$systemOptions['datadirectory'] = $this->datadir;
$systemOptions['appstoreenabled'] = false; //it's likely that there is no app folder we can write in
- $config = $this->getMockBuilder('\OCP\IConfig')
+ $config = $this->getMockBuilder('\OC\SystemConfig')
->disableOriginalConstructor()
->getMock();
$config->expects($this->any())
- ->method('getSystemValue')
+ ->method('getValue')
->will($this->returnCallback(function ($key, $default) use ($systemOptions) {
return isset($systemOptions[$key]) ? $systemOptions[$key] : $default;
}));