aboutsummaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2021-03-02 21:46:51 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2021-03-02 21:46:51 +0100
commitdc7eb2bd85dbf2d43dcabd15b6f5ecdd65c6cb6e (patch)
treee344b66abd6686fecb8fc63bd8fb5d404db7e578 /apps/provisioning_api/tests
parentef5389603c79df944ec5d0573e6e745c22c213e3 (diff)
downloadnextcloud-server-dc7eb2bd85dbf2d43dcabd15b6f5ecdd65c6cb6e.tar.gz
nextcloud-server-dc7eb2bd85dbf2d43dcabd15b6f5ecdd65c6cb6e.zip
LoggerInterface for provisioning API Controllers
Sweep swoop swaap swuup away with the deprecated stuff Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/provisioning_api/tests')
-rw-r--r--apps/provisioning_api/tests/Controller/GroupsControllerTest.php6
-rw-r--r--apps/provisioning_api/tests/Controller/UsersControllerTest.php19
2 files changed, 13 insertions, 12 deletions
diff --git a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php
index bb8ec854390..0624c9e0b75 100644
--- a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php
+++ b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php
@@ -37,13 +37,13 @@ use OC\User\NoUserException;
use OCA\Provisioning_API\Controller\GroupsController;
use OCP\Accounts\IAccountManager;
use OCP\IConfig;
-use OCP\ILogger;
use OCP\IRequest;
use OCP\IUser;
use OCP\IUserManager;
use OCP\IUserSession;
use OCP\L10N\IFactory;
use OCP\UserInterface;
+use Psr\Log\LoggerInterface;
class GroupsControllerTest extends \Test\TestCase {
@@ -59,7 +59,7 @@ class GroupsControllerTest extends \Test\TestCase {
protected $userSession;
/** @var AccountManager|\PHPUnit\Framework\MockObject\MockObject */
protected $accountManager;
- /** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
protected $logger;
/** @var SubAdmin|\PHPUnit\Framework\MockObject\MockObject */
protected $subAdminManager;
@@ -78,7 +78,7 @@ class GroupsControllerTest extends \Test\TestCase {
$this->userSession = $this->createMock(IUserSession::class);
$this->accountManager = $this->createMock(AccountManager::class);
$this->l10nFactory = $this->createMock(IFactory::class);
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->subAdminManager = $this->createMock(SubAdmin::class);
diff --git a/apps/provisioning_api/tests/Controller/UsersControllerTest.php b/apps/provisioning_api/tests/Controller/UsersControllerTest.php
index 10f5a4841d4..3130fce3e9c 100644
--- a/apps/provisioning_api/tests/Controller/UsersControllerTest.php
+++ b/apps/provisioning_api/tests/Controller/UsersControllerTest.php
@@ -56,7 +56,6 @@ use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\IGroup;
use OCP\IL10N;
-use OCP\ILogger;
use OCP\IRequest;
use OCP\IURLGenerator;
use OCP\IUser;
@@ -68,6 +67,7 @@ use OCP\Security\Events\GenerateSecurePasswordEvent;
use OCP\Security\ISecureRandom;
use OCP\UserInterface;
use PHPUnit\Framework\MockObject\MockObject;
+use Psr\Log\LoggerInterface;
use Test\TestCase;
class UsersControllerTest extends TestCase {
@@ -82,7 +82,7 @@ class UsersControllerTest extends TestCase {
protected $groupManager;
/** @var IUserSession|MockObject */
protected $userSession;
- /** @var ILogger|MockObject */
+ /** @var LoggerInterface|MockObject */
protected $logger;
/** @var UsersController|MockObject */
protected $api;
@@ -113,7 +113,7 @@ class UsersControllerTest extends TestCase {
$this->appManager = $this->createMock(IAppManager::class);
$this->groupManager = $this->createMock(Manager::class);
$this->userSession = $this->createMock(IUserSession::class);
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->request = $this->createMock(IRequest::class);
$this->accountManager = $this->createMock(AccountManager::class);
$this->urlGenerator = $this->createMock(IURLGenerator::class);
@@ -715,12 +715,13 @@ class UsersControllerTest extends TestCase {
->will($this->throwException($exception));
$this->logger
->expects($this->once())
- ->method('logException')
- ->with($exception, [
- 'message' => 'Failed addUser attempt with exception.',
- 'level' => ILogger::ERROR,
- 'app' => 'ocs_api',
- ]);
+ ->method('error')
+ ->with('Failed addUser attempt with exception.',
+ [
+ 'app' => 'ocs_api',
+ 'exception' => $exception
+ ]
+ );
$loggedInUser = $this->getMockBuilder(IUser::class)
->disableOriginalConstructor()
->getMock();