Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-11-27 18:40:12 +0300
committerMorris Jobke <hey@morrisjobke.de>2014-12-09 00:29:42 +0300
commit50c2a819a0c5ae50571d36a3e2dec4e8267fd13b (patch)
treec6241e94b567618b9f6e7952f45a3aaa11250d49 /tests
parentf219f5a7a62fe88b364b9a5f50e9730eba1ee84c (diff)
Extract interaction with config.php into SystemConfig
* introduce SystemConfig to avoid DI circle (used by database connection which is itself needed by AllConfig that itself contains the methods to access the config.php which then would need the database connection - did you get it? ;)) * use DI container and use that method in legacy code paths (for easier refactoring later) * create and use getSystemConfig instead of query() in DI container
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/user/user.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/lib/user/user.php b/tests/lib/user/user.php
index 6aa7243a75a..85ade9ccaf1 100644
--- a/tests/lib/user/user.php
+++ b/tests/lib/user/user.php
@@ -228,10 +228,19 @@ class User extends \Test\TestCase {
->method('implementsActions')
->will($this->returnValue(false));
- $allConfig = new AllConfig();
+ $allConfig = $this->getMockBuilder('\OC\AllConfig')
+ ->disableOriginalConstructor()
+ ->getMock();
+ $allConfig->expects($this->any())
+ ->method('getUserValue')
+ ->will($this->returnValue(true));
+ $allConfig->expects($this->any())
+ ->method('getSystemValue')
+ ->with($this->equalTo('datadirectory'))
+ ->will($this->returnValue('arbitrary/path'));
$user = new \OC\User\User('foo', $backend, null, $allConfig);
- $this->assertEquals(\OC_Config::getValue("datadirectory", \OC::$SERVERROOT . "/data") . '/foo', $user->getHome());
+ $this->assertEquals('arbitrary/path/foo', $user->getHome());
}
public function testCanChangePassword() {