migrate \OC\AllConfig to \OCP\IConfig
This commit is contained in:
parent
719008836d
commit
a9e411e076
|
@ -8,16 +8,18 @@
|
||||||
|
|
||||||
namespace OC;
|
namespace OC;
|
||||||
|
|
||||||
|
use \OCP\IConfig;
|
||||||
|
|
||||||
class HTTPHelper {
|
class HTTPHelper {
|
||||||
const USER_AGENT = 'ownCloud Server Crawler';
|
const USER_AGENT = 'ownCloud Server Crawler';
|
||||||
|
|
||||||
/** @var \OC\AllConfig */
|
/** @var \OCP\IConfig */
|
||||||
private $config;
|
private $config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \OC\AllConfig $config
|
* @param \OCP\IConfig $config
|
||||||
*/
|
*/
|
||||||
public function __construct(AllConfig $config) {
|
public function __construct(IConfig $config) {
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ namespace OC\User;
|
||||||
|
|
||||||
use OC\Hooks\PublicEmitter;
|
use OC\Hooks\PublicEmitter;
|
||||||
use OCP\IUserManager;
|
use OCP\IUserManager;
|
||||||
|
use OCP\IConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Manager
|
* Class Manager
|
||||||
|
@ -37,14 +38,14 @@ class Manager extends PublicEmitter implements IUserManager {
|
||||||
private $cachedUsers = array();
|
private $cachedUsers = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \OC\AllConfig $config
|
* @var \OCP\IConfig $config
|
||||||
*/
|
*/
|
||||||
private $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;
|
$this->config = $config;
|
||||||
$cachedUsers = &$this->cachedUsers;
|
$cachedUsers = &$this->cachedUsers;
|
||||||
$this->listen('\OC\User', 'postDelete', function ($user) use (&$cachedUsers) {
|
$this->listen('\OC\User', 'postDelete', function ($user) use (&$cachedUsers) {
|
||||||
|
|
|
@ -11,6 +11,7 @@ namespace OC\User;
|
||||||
|
|
||||||
use OC\Hooks\Emitter;
|
use OC\Hooks\Emitter;
|
||||||
use OCP\IUser;
|
use OCP\IUser;
|
||||||
|
use OCP\IConfig;
|
||||||
|
|
||||||
class User implements IUser {
|
class User implements IUser {
|
||||||
/**
|
/**
|
||||||
|
@ -49,7 +50,7 @@ class User implements IUser {
|
||||||
private $lastLogin;
|
private $lastLogin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \OC\AllConfig $config
|
* @var \OCP\IConfig $config
|
||||||
*/
|
*/
|
||||||
private $config;
|
private $config;
|
||||||
|
|
||||||
|
@ -57,9 +58,9 @@ class User implements IUser {
|
||||||
* @param string $uid
|
* @param string $uid
|
||||||
* @param \OC_User_Interface $backend
|
* @param \OC_User_Interface $backend
|
||||||
* @param \OC\Hooks\Emitter $emitter
|
* @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->uid = $uid;
|
||||||
$this->backend = $backend;
|
$this->backend = $backend;
|
||||||
$this->emitter = $emitter;
|
$this->emitter = $emitter;
|
||||||
|
|
|
@ -19,7 +19,7 @@ class InfoParser extends \PHPUnit_Framework_TestCase {
|
||||||
private $parser;
|
private $parser;
|
||||||
|
|
||||||
public function setUp() {
|
public function setUp() {
|
||||||
$config = $this->getMockBuilder('\OC\AllConfig')
|
$config = $this->getMockBuilder('\OCP\IConfig')
|
||||||
->disableOriginalConstructor()->getMock();
|
->disableOriginalConstructor()->getMock();
|
||||||
$httpHelper = $this->getMockBuilder('\OC\HTTPHelper')
|
$httpHelper = $this->getMockBuilder('\OC\HTTPHelper')
|
||||||
->setConstructorArgs(array($config))
|
->setConstructorArgs(array($config))
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
class TestHTTPHelper extends \Test\TestCase {
|
class TestHTTPHelper extends \Test\TestCase {
|
||||||
|
|
||||||
/** @var \OC\AllConfig*/
|
/** @var \OCP\IConfig*/
|
||||||
private $config;
|
private $config;
|
||||||
/** @var \OC\HTTPHelper */
|
/** @var \OC\HTTPHelper */
|
||||||
private $httpHelperMock;
|
private $httpHelperMock;
|
||||||
|
@ -16,7 +16,7 @@ class TestHTTPHelper extends \Test\TestCase {
|
||||||
protected function setUp() {
|
protected function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
$this->config = $this->getMockBuilder('\OC\AllConfig')
|
$this->config = $this->getMockBuilder('\OCP\IConfig')
|
||||||
->disableOriginalConstructor()->getMock();
|
->disableOriginalConstructor()->getMock();
|
||||||
$this->httpHelperMock = $this->getMockBuilder('\OC\HTTPHelper')
|
$this->httpHelperMock = $this->getMockBuilder('\OC\HTTPHelper')
|
||||||
->setConstructorArgs(array($this->config))
|
->setConstructorArgs(array($this->config))
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
namespace Test\User;
|
namespace Test\User;
|
||||||
|
|
||||||
use OC\AllConfig;
|
|
||||||
use OC\Hooks\PublicEmitter;
|
use OC\Hooks\PublicEmitter;
|
||||||
|
|
||||||
class User extends \Test\TestCase {
|
class User extends \Test\TestCase {
|
||||||
|
@ -228,7 +227,7 @@ class User extends \Test\TestCase {
|
||||||
->method('implementsActions')
|
->method('implementsActions')
|
||||||
->will($this->returnValue(false));
|
->will($this->returnValue(false));
|
||||||
|
|
||||||
$allConfig = $this->getMockBuilder('\OC\AllConfig')
|
$allConfig = $this->getMockBuilder('\OCP\IConfig')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$allConfig->expects($this->any())
|
$allConfig->expects($this->any())
|
||||||
|
|
Loading…
Reference in New Issue