summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2015-12-18 11:24:15 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2015-12-18 11:53:41 +0100
commit0a09004d39b5d27124d59ed45debf109170b24d2 (patch)
treeb58a53749187396ed6ed5a962a15f06c66b071b8 /tests
parent82bf99c0cfd764b25d1442cf199f219cd852ff69 (diff)
downloadnextcloud-server-0a09004d39b5d27124d59ed45debf109170b24d2.tar.gz
nextcloud-server-0a09004d39b5d27124d59ed45debf109170b24d2.zip
Inject Config into SystemConfig
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/allconfig.php16
-rw-r--r--tests/lib/server.php3
2 files changed, 14 insertions, 5 deletions
diff --git a/tests/lib/allconfig.php b/tests/lib/allconfig.php
index ca3dce12eaf..0caf8163cfc 100644
--- a/tests/lib/allconfig.php
+++ b/tests/lib/allconfig.php
@@ -28,7 +28,9 @@ class TestAllConfig extends \Test\TestCase {
$connection = $this->connection;
}
if($systemConfig === null) {
- $systemConfig = $this->getMock('\OC\SystemConfig');
+ $systemConfig = $this->getMockBuilder('\OC\SystemConfig')
+ ->disableOriginalConstructor()
+ ->getMock();
}
return new \OC\AllConfig($systemConfig, $connection);
}
@@ -89,7 +91,9 @@ class TestAllConfig extends \Test\TestCase {
public function testSetUserValueWithPreCondition() {
// mock the check for the database to run the correct SQL statements for each database type
- $systemConfig = $this->getMock('\OC\SystemConfig');
+ $systemConfig = $this->getMockBuilder('\OC\SystemConfig')
+ ->disableOriginalConstructor()
+ ->getMock();
$systemConfig->expects($this->once())
->method('getValue')
->with($this->equalTo('dbtype'),
@@ -133,7 +137,9 @@ class TestAllConfig extends \Test\TestCase {
*/
public function testSetUserValueWithPreConditionFailure() {
// mock the check for the database to run the correct SQL statements for each database type
- $systemConfig = $this->getMock('\OC\SystemConfig');
+ $systemConfig = $this->getMockBuilder('\OC\SystemConfig')
+ ->disableOriginalConstructor()
+ ->getMock();
$systemConfig->expects($this->once())
->method('getValue')
->with($this->equalTo('dbtype'),
@@ -394,7 +400,9 @@ class TestAllConfig extends \Test\TestCase {
public function testGetUsersForUserValue() {
// mock the check for the database to run the correct SQL statements for each database type
- $systemConfig = $this->getMock('\OC\SystemConfig');
+ $systemConfig = $this->getMockBuilder('\OC\SystemConfig')
+ ->disableOriginalConstructor()
+ ->getMock();
$systemConfig->expects($this->once())
->method('getValue')
->with($this->equalTo('dbtype'),
diff --git a/tests/lib/server.php b/tests/lib/server.php
index 6b569e77dd9..e2670061e8d 100644
--- a/tests/lib/server.php
+++ b/tests/lib/server.php
@@ -38,7 +38,8 @@ class Server extends \Test\TestCase {
public function setUp() {
parent::setUp();
- $this->server = new \OC\Server('');
+ $config = new \OC\Config(\OC::$configDir);
+ $this->server = new \OC\Server('', $config);
}
public function dataTestQuery() {