summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Memcache/FactoryTest.php9
-rw-r--r--tests/lib/TestCase.php2
-rw-r--r--tests/lib/Traits/EncryptionTrait.php2
-rw-r--r--tests/lib/UserTest.php55
4 files changed, 7 insertions, 61 deletions
diff --git a/tests/lib/Memcache/FactoryTest.php b/tests/lib/Memcache/FactoryTest.php
index ce6c25cd87f..1944b1bd35d 100644
--- a/tests/lib/Memcache/FactoryTest.php
+++ b/tests/lib/Memcache/FactoryTest.php
@@ -20,9 +20,10 @@
*/
namespace Test\Memcache;
+use OC\Memcache\NullCache;
use OCP\ILogger;
-class Test_Factory_Available_Cache1 {
+class Test_Factory_Available_Cache1 extends NullCache {
public function __construct($prefix = '') {
}
@@ -31,7 +32,7 @@ class Test_Factory_Available_Cache1 {
}
}
-class Test_Factory_Available_Cache2 {
+class Test_Factory_Available_Cache2 extends NullCache {
public function __construct($prefix = '') {
}
@@ -40,7 +41,7 @@ class Test_Factory_Available_Cache2 {
}
}
-class Test_Factory_Unavailable_Cache1 {
+class Test_Factory_Unavailable_Cache1 extends NullCache {
public function __construct($prefix = '') {
}
@@ -49,7 +50,7 @@ class Test_Factory_Unavailable_Cache1 {
}
}
-class Test_Factory_Unavailable_Cache2 {
+class Test_Factory_Unavailable_Cache2 extends NullCache {
public function __construct($prefix = '') {
}
diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php
index 64036084dc2..345b2a68e6f 100644
--- a/tests/lib/TestCase.php
+++ b/tests/lib/TestCase.php
@@ -385,7 +385,7 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
$userObject->updateLastLoginTimestamp();
}
\OC_Util::setupFS($user);
- if (\OC_User::userExists($user)) {
+ if (\OC::$server->getUserManager()->userExists($user)) {
\OC::$server->getUserFolder($user);
}
}
diff --git a/tests/lib/Traits/EncryptionTrait.php b/tests/lib/Traits/EncryptionTrait.php
index 8a06d37fa7f..ba759a51a28 100644
--- a/tests/lib/Traits/EncryptionTrait.php
+++ b/tests/lib/Traits/EncryptionTrait.php
@@ -50,7 +50,7 @@ trait EncryptionTrait {
\OC_User::setUserId($user);
$this->postLogin();
\OC_Util::setupFS($user);
- if (\OC_User::userExists($user)) {
+ if (\OC::$server->getUserManager()->userExists($user)) {
\OC::$server->getUserFolder($user);
}
}
diff --git a/tests/lib/UserTest.php b/tests/lib/UserTest.php
deleted file mode 100644
index 2a477522dea..00000000000
--- a/tests/lib/UserTest.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-
-/**
- * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-namespace Test;
-
-/**
- * Class User
- *
- * @group DB
- *
- * @package Test
- */
-class UserTest extends TestCase {
- /**
- * @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
- */
- private $backend;
-
- protected function setUp(){
- parent::setUp();
-
- $this->backend = $this->createMock(\Test\Util\User\Dummy::class);
- $manager = \OC::$server->getUserManager();
- $manager->registerBackend($this->backend);
- }
-
- public function testCheckPassword() {
-
- $this->backend->expects($this->once())
- ->method('checkPassword')
- ->with($this->equalTo('foo'), $this->equalTo('bar'))
- ->will($this->returnValue('foo'))
- ;
-
- $this->backend->expects($this->any())
- ->method('implementsActions')
- ->will($this->returnCallback(function ($actions) {
- if ($actions === \OC\USER\BACKEND::CHECK_PASSWORD) {
- return true;
- } else {
- return false;
- }
- }));
-
- $uid = \OC_User::checkPassword('foo', 'bar');
- $this->assertEquals($uid, 'foo');
- }
-
-}