migrate \OC\AllConfig to \OCP\IConfig

This commit is contained in:
Morris Jobke 2014-11-27 18:19:14 +01:00
parent 719008836d
commit a9e411e076
6 changed files with 17 additions and 14 deletions

View File

@ -8,16 +8,18 @@
namespace OC;
use \OCP\IConfig;
class HTTPHelper {
const USER_AGENT = 'ownCloud Server Crawler';
/** @var \OC\AllConfig */
/** @var \OCP\IConfig */
private $config;
/**
* @param \OC\AllConfig $config
* @param \OCP\IConfig $config
*/
public function __construct(AllConfig $config) {
public function __construct(IConfig $config) {
$this->config = $config;
}

View File

@ -11,6 +11,7 @@ namespace OC\User;
use OC\Hooks\PublicEmitter;
use OCP\IUserManager;
use OCP\IConfig;
/**
* Class Manager
@ -37,14 +38,14 @@ class Manager extends PublicEmitter implements IUserManager {
private $cachedUsers = array();
/**
* @var \OC\AllConfig $config
* @var \OCP\IConfig $config
*/
private $config;
/**
* @param \OC\AllConfig $config
* @param \OCP\IConfig $config
*/
public function __construct($config = null) {
public function __construct(IConfig $config = null) {
$this->config = $config;
$cachedUsers = &$this->cachedUsers;
$this->listen('\OC\User', 'postDelete', function ($user) use (&$cachedUsers) {

View File

@ -11,6 +11,7 @@ namespace OC\User;
use OC\Hooks\Emitter;
use OCP\IUser;
use OCP\IConfig;
class User implements IUser {
/**
@ -49,7 +50,7 @@ class User implements IUser {
private $lastLogin;
/**
* @var \OC\AllConfig $config
* @var \OCP\IConfig $config
*/
private $config;
@ -57,9 +58,9 @@ class User implements IUser {
* @param string $uid
* @param \OC_User_Interface $backend
* @param \OC\Hooks\Emitter $emitter
* @param \OC\AllConfig $config
* @param \OCP\IConfig $config
*/
public function __construct($uid, $backend, $emitter = null, $config = null) {
public function __construct($uid, $backend, $emitter = null, IConfig $config = null) {
$this->uid = $uid;
$this->backend = $backend;
$this->emitter = $emitter;

View File

@ -19,7 +19,7 @@ class InfoParser extends \PHPUnit_Framework_TestCase {
private $parser;
public function setUp() {
$config = $this->getMockBuilder('\OC\AllConfig')
$config = $this->getMockBuilder('\OCP\IConfig')
->disableOriginalConstructor()->getMock();
$httpHelper = $this->getMockBuilder('\OC\HTTPHelper')
->setConstructorArgs(array($config))

View File

@ -8,7 +8,7 @@
class TestHTTPHelper extends \Test\TestCase {
/** @var \OC\AllConfig*/
/** @var \OCP\IConfig*/
private $config;
/** @var \OC\HTTPHelper */
private $httpHelperMock;
@ -16,7 +16,7 @@ class TestHTTPHelper extends \Test\TestCase {
protected function setUp() {
parent::setUp();
$this->config = $this->getMockBuilder('\OC\AllConfig')
$this->config = $this->getMockBuilder('\OCP\IConfig')
->disableOriginalConstructor()->getMock();
$this->httpHelperMock = $this->getMockBuilder('\OC\HTTPHelper')
->setConstructorArgs(array($this->config))

View File

@ -9,7 +9,6 @@
namespace Test\User;
use OC\AllConfig;
use OC\Hooks\PublicEmitter;
class User extends \Test\TestCase {
@ -228,7 +227,7 @@ class User extends \Test\TestCase {
->method('implementsActions')
->will($this->returnValue(false));
$allConfig = $this->getMockBuilder('\OC\AllConfig')
$allConfig = $this->getMockBuilder('\OCP\IConfig')
->disableOriginalConstructor()
->getMock();
$allConfig->expects($this->any())