diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-01-16 13:27:45 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2018-01-16 18:39:11 +0100 |
commit | 55532f19d90b40f7f46354b92a5322676729ba7e (patch) | |
tree | c29ee88dbb789c7c0aa9c9f1c08fccef27272d7f /tests/lib | |
parent | a159d7c28c483a2b77e2f533795f6d6d1ec720fd (diff) | |
download | nextcloud-server-55532f19d90b40f7f46354b92a5322676729ba7e.tar.gz nextcloud-server-55532f19d90b40f7f46354b92a5322676729ba7e.zip |
Cleanup OC_User and OCP\User
* mainly removes deprecated methods and old static code
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/TestCase.php | 2 | ||||
-rw-r--r-- | tests/lib/Traits/EncryptionTrait.php | 2 | ||||
-rw-r--r-- | tests/lib/UserTest.php | 55 |
3 files changed, 2 insertions, 57 deletions
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'); - } - -} |