diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2021-03-02 21:46:51 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2021-03-02 21:46:51 +0100 |
commit | dc7eb2bd85dbf2d43dcabd15b6f5ecdd65c6cb6e (patch) | |
tree | e344b66abd6686fecb8fc63bd8fb5d404db7e578 /apps/provisioning_api/tests/Controller/UsersControllerTest.php | |
parent | ef5389603c79df944ec5d0573e6e745c22c213e3 (diff) | |
download | nextcloud-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/Controller/UsersControllerTest.php')
-rw-r--r-- | apps/provisioning_api/tests/Controller/UsersControllerTest.php | 19 |
1 files changed, 10 insertions, 9 deletions
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(); |