summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/user.php2
-rw-r--r--tests/lib/user/backend.php2
-rw-r--r--tests/lib/user/database.php2
-rw-r--r--tests/lib/user/manager.php4
-rw-r--r--tests/lib/user/user.php80
-rw-r--r--tests/lib/util/user/dummy.php4
-rw-r--r--tests/settings/controller/userscontrollertest.php4
7 files changed, 49 insertions, 49 deletions
diff --git a/tests/lib/user.php b/tests/lib/user.php
index c4c74cbc254..dc5551d1cad 100644
--- a/tests/lib/user.php
+++ b/tests/lib/user.php
@@ -18,7 +18,7 @@ namespace Test;
*/
class User extends TestCase {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
private $backend;
diff --git a/tests/lib/user/backend.php b/tests/lib/user/backend.php
index c2040f4e3be..d5bbbe9f406 100644
--- a/tests/lib/user/backend.php
+++ b/tests/lib/user/backend.php
@@ -32,7 +32,7 @@
abstract class Test_User_Backend extends \Test\TestCase {
/**
- * @var OC_User_Backend $backend
+ * @var \OC\User\Backend $backend
*/
protected $backend;
diff --git a/tests/lib/user/database.php b/tests/lib/user/database.php
index ba44d333a8c..0dea037ad78 100644
--- a/tests/lib/user/database.php
+++ b/tests/lib/user/database.php
@@ -37,7 +37,7 @@ class Test_User_Database extends Test_User_Backend {
protected function setUp() {
parent::setUp();
- $this->backend=new OC_User_Database();
+ $this->backend=new \OC\User\Database();
}
protected function tearDown() {
diff --git a/tests/lib/user/manager.php b/tests/lib/user/manager.php
index 90e2f67c995..14221e4a665 100644
--- a/tests/lib/user/manager.php
+++ b/tests/lib/user/manager.php
@@ -118,7 +118,7 @@ class Manager extends \Test\TestCase {
public function testCheckPassword() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
$backend = $this->getMock('\Test\Util\User\Dummy');
$backend->expects($this->once())
@@ -145,7 +145,7 @@ class Manager extends \Test\TestCase {
public function testCheckPasswordNotSupported() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
$backend = $this->getMock('\Test\Util\User\Dummy');
$backend->expects($this->never())
diff --git a/tests/lib/user/user.php b/tests/lib/user/user.php
index a8d688d9c88..0a972f7bdaa 100644
--- a/tests/lib/user/user.php
+++ b/tests/lib/user/user.php
@@ -21,9 +21,9 @@ use OC\Hooks\PublicEmitter;
class User extends \Test\TestCase {
public function testDisplayName() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\OC_User_Backend');
+ $backend = $this->getMock('\OC\User\Backend');
$backend->expects($this->once())
->method('getDisplayName')
->with($this->equalTo('foo'))
@@ -31,7 +31,7 @@ class User extends \Test\TestCase {
$backend->expects($this->any())
->method('implementsActions')
- ->with($this->equalTo(\OC_USER_BACKEND_GET_DISPLAYNAME))
+ ->with($this->equalTo(\OC\User\Backend::GET_DISPLAYNAME))
->will($this->returnValue(true));
$user = new \OC\User\User('foo', $backend);
@@ -43,9 +43,9 @@ class User extends \Test\TestCase {
*/
public function testDisplayNameEmpty() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\OC_User_Backend');
+ $backend = $this->getMock('\OC\User\Backend');
$backend->expects($this->once())
->method('getDisplayName')
->with($this->equalTo('foo'))
@@ -53,7 +53,7 @@ class User extends \Test\TestCase {
$backend->expects($this->any())
->method('implementsActions')
- ->with($this->equalTo(\OC_USER_BACKEND_GET_DISPLAYNAME))
+ ->with($this->equalTo(\OC\User\Backend::GET_DISPLAYNAME))
->will($this->returnValue(true));
$user = new \OC\User\User('foo', $backend);
@@ -62,15 +62,15 @@ class User extends \Test\TestCase {
public function testDisplayNameNotSupported() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\OC_User_Backend');
+ $backend = $this->getMock('\OC\User\Backend');
$backend->expects($this->never())
->method('getDisplayName');
$backend->expects($this->any())
->method('implementsActions')
- ->with($this->equalTo(\OC_USER_BACKEND_GET_DISPLAYNAME))
+ ->with($this->equalTo(\OC\User\Backend::GET_DISPLAYNAME))
->will($this->returnValue(false));
$user = new \OC\User\User('foo', $backend);
@@ -79,7 +79,7 @@ class User extends \Test\TestCase {
public function testSetPassword() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
$backend = $this->getMock('\Test\Util\User\Dummy');
$backend->expects($this->once())
@@ -89,7 +89,7 @@ class User extends \Test\TestCase {
$backend->expects($this->any())
->method('implementsActions')
->will($this->returnCallback(function ($actions) {
- if ($actions === \OC_USER_BACKEND_SET_PASSWORD) {
+ if ($actions === \OC\User\Backend::SET_PASSWORD) {
return true;
} else {
return false;
@@ -102,7 +102,7 @@ class User extends \Test\TestCase {
public function testSetPasswordNotSupported() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
$backend = $this->getMock('\Test\Util\User\Dummy');
$backend->expects($this->never())
@@ -118,7 +118,7 @@ class User extends \Test\TestCase {
public function testChangeAvatarSupportedYes() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
require_once 'avataruserdummy.php';
$backend = $this->getMock('Avatar_User_Dummy');
@@ -130,7 +130,7 @@ class User extends \Test\TestCase {
$backend->expects($this->any())
->method('implementsActions')
->will($this->returnCallback(function ($actions) {
- if ($actions === \OC_USER_BACKEND_PROVIDE_AVATAR) {
+ if ($actions === \OC\User\Backend::PROVIDE_AVATAR) {
return true;
} else {
return false;
@@ -143,7 +143,7 @@ class User extends \Test\TestCase {
public function testChangeAvatarSupportedNo() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
require_once 'avataruserdummy.php';
$backend = $this->getMock('Avatar_User_Dummy');
@@ -155,7 +155,7 @@ class User extends \Test\TestCase {
$backend->expects($this->any())
->method('implementsActions')
->will($this->returnCallback(function ($actions) {
- if ($actions === \OC_USER_BACKEND_PROVIDE_AVATAR) {
+ if ($actions === \OC\User\Backend::PROVIDE_AVATAR) {
return true;
} else {
return false;
@@ -168,7 +168,7 @@ class User extends \Test\TestCase {
public function testChangeAvatarNotSupported() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
require_once 'avataruserdummy.php';
$backend = $this->getMock('Avatar_User_Dummy');
@@ -187,7 +187,7 @@ class User extends \Test\TestCase {
public function testDelete() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
$backend = $this->getMock('\Test\Util\User\Dummy');
$backend->expects($this->once())
@@ -200,7 +200,7 @@ class User extends \Test\TestCase {
public function testGetHome() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
$backend = $this->getMock('\Test\Util\User\Dummy');
$backend->expects($this->once())
@@ -211,7 +211,7 @@ class User extends \Test\TestCase {
$backend->expects($this->any())
->method('implementsActions')
->will($this->returnCallback(function ($actions) {
- if ($actions === \OC_USER_BACKEND_GET_HOME) {
+ if ($actions === \OC\User\Backend::GET_HOME) {
return true;
} else {
return false;
@@ -225,13 +225,13 @@ class User extends \Test\TestCase {
public function testGetBackendClassName() {
$user = new \OC\User\User('foo', new \Test\Util\User\Dummy());
$this->assertEquals('Dummy', $user->getBackendClassName());
- $user = new \OC\User\User('foo', new \OC_User_Database());
+ $user = new \OC\User\User('foo', new \OC\User\Database());
$this->assertEquals('Database', $user->getBackendClassName());
}
public function testGetHomeNotSupported() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
$backend = $this->getMock('\Test\Util\User\Dummy');
$backend->expects($this->never())
@@ -258,14 +258,14 @@ class User extends \Test\TestCase {
public function testCanChangePassword() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
$backend = $this->getMock('\Test\Util\User\Dummy');
$backend->expects($this->any())
->method('implementsActions')
->will($this->returnCallback(function ($actions) {
- if ($actions === \OC_USER_BACKEND_SET_PASSWORD) {
+ if ($actions === \OC\User\Backend::SET_PASSWORD) {
return true;
} else {
return false;
@@ -278,7 +278,7 @@ class User extends \Test\TestCase {
public function testCanChangePasswordNotSupported() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
$backend = $this->getMock('\Test\Util\User\Dummy');
@@ -292,14 +292,14 @@ class User extends \Test\TestCase {
public function testCanChangeDisplayName() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
$backend = $this->getMock('\Test\Util\User\Dummy');
$backend->expects($this->any())
->method('implementsActions')
->will($this->returnCallback(function ($actions) {
- if ($actions === \OC_USER_BACKEND_SET_DISPLAYNAME) {
+ if ($actions === \OC\User\Backend::SET_DISPLAYNAME) {
return true;
} else {
return false;
@@ -312,7 +312,7 @@ class User extends \Test\TestCase {
public function testCanChangeDisplayNameNotSupported() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
$backend = $this->getMock('\Test\Util\User\Dummy');
@@ -326,14 +326,14 @@ class User extends \Test\TestCase {
public function testSetDisplayNameSupported() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\OC_User_Database');
+ $backend = $this->getMock('\OC\User\Database');
$backend->expects($this->any())
->method('implementsActions')
->will($this->returnCallback(function ($actions) {
- if ($actions === \OC_USER_BACKEND_SET_DISPLAYNAME) {
+ if ($actions === \OC\User\Backend::SET_DISPLAYNAME) {
return true;
} else {
return false;
@@ -355,14 +355,14 @@ class User extends \Test\TestCase {
*/
public function testSetDisplayNameEmpty() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\OC_User_Database');
+ $backend = $this->getMock('\OC\User\Database');
$backend->expects($this->any())
->method('implementsActions')
->will($this->returnCallback(function ($actions) {
- if ($actions === \OC_USER_BACKEND_SET_DISPLAYNAME) {
+ if ($actions === \OC\User\Backend::SET_DISPLAYNAME) {
return true;
} else {
return false;
@@ -376,9 +376,9 @@ class User extends \Test\TestCase {
public function testSetDisplayNameNotSupported() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\OC_User_Database');
+ $backend = $this->getMock('\OC\User\Database');
$backend->expects($this->any())
->method('implementsActions')
@@ -399,7 +399,7 @@ class User extends \Test\TestCase {
$test = $this;
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
$backend = $this->getMock('\Test\Util\User\Dummy');
$backend->expects($this->once())
@@ -422,7 +422,7 @@ class User extends \Test\TestCase {
$backend->expects($this->any())
->method('implementsActions')
->will($this->returnCallback(function ($actions) {
- if ($actions === \OC_USER_BACKEND_SET_PASSWORD) {
+ if ($actions === \OC\User\Backend::SET_PASSWORD) {
return true;
} else {
return false;
@@ -440,7 +440,7 @@ class User extends \Test\TestCase {
$test = $this;
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
$backend = $this->getMock('\Test\Util\User\Dummy');
$backend->expects($this->once())
@@ -465,7 +465,7 @@ class User extends \Test\TestCase {
public function testGetCloudId() {
/**
- * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
+ * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
$backend = $this->getMock('\Test\Util\User\Dummy');
$urlGenerator = $this->getMockBuilder('\OC\URLGenerator')
diff --git a/tests/lib/util/user/dummy.php b/tests/lib/util/user/dummy.php
index 6e23e22ab67..ea47f5d7d15 100644
--- a/tests/lib/util/user/dummy.php
+++ b/tests/lib/util/user/dummy.php
@@ -27,12 +27,12 @@
namespace Test\Util\User;
-use OC_User_Backend;
+use \OC\User\Backend;
/**
* dummy user backend, does not keep state, only for testing use
*/
-class Dummy extends OC_User_Backend implements \OCP\IUserBackend {
+class Dummy extends Backend implements \OCP\IUserBackend {
private $users = array();
private $displayNames = array();
diff --git a/tests/settings/controller/userscontrollertest.php b/tests/settings/controller/userscontrollertest.php
index 6f07f34ba8d..2a2b53d8ff8 100644
--- a/tests/settings/controller/userscontrollertest.php
+++ b/tests/settings/controller/userscontrollertest.php
@@ -668,7 +668,7 @@ class UsersControllerTest extends \Test\TestCase {
$this->container['UserManager']
->expects($this->once())
->method('getBackends')
- ->will($this->returnValue([new \Test\Util\User\Dummy(), new \OC_User_Database()]));
+ ->will($this->returnValue([new \Test\Util\User\Dummy(), new \OC\User\Database()]));
$this->container['UserManager']
->expects($this->once())
->method('clearBackends');
@@ -716,7 +716,7 @@ class UsersControllerTest extends \Test\TestCase {
$this->container['UserManager']
->expects($this->once())
->method('getBackends')
- ->will($this->returnValue([new \Test\Util\User\Dummy(), new \OC_User_Database()]));
+ ->will($this->returnValue([new \Test\Util\User\Dummy(), new \OC\User\Database()]));
$this->container['UserManager']
->expects($this->once())
->method('search')