From 24f280500abf7a63b02e4e674b000de9bc3dda1f Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 16 Jan 2024 16:41:11 +0100 Subject: [PATCH] fix(tests): Remove deprecated syntax Signed-off-by: Ferdinand Thiessen --- tests/CurrentUserTest.php | 8 +++++++- tests/Listener/SetUserDefaultsTest.php | 10 ++++++++++ tests/Listener/UserDeletedTest.php | 5 +++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/CurrentUserTest.php b/tests/CurrentUserTest.php index 7254ac592..f204eb3bb 100644 --- a/tests/CurrentUserTest.php +++ b/tests/CurrentUserTest.php @@ -45,10 +45,16 @@ class CurrentUserTest extends TestCase { /** @var IManager|MockObject */ protected $shareManager; + /** + * + */ + protected function setUp(): void { parent::setUp(); - $this->request = $this->createMock(IRequest::class); + $this->request = $this->getMockBuilder(IRequest::class) + ->disableOriginalConstructor() + ->getMock(); $this->userSession = $this->createMock(IUserSession::class); $this->shareManager = $this->createMock(IManager::class); } diff --git a/tests/Listener/SetUserDefaultsTest.php b/tests/Listener/SetUserDefaultsTest.php index 4a4ec2c84..8f086b454 100644 --- a/tests/Listener/SetUserDefaultsTest.php +++ b/tests/Listener/SetUserDefaultsTest.php @@ -42,6 +42,16 @@ class SetUserDefaultsTest extends TestCase { */ private $listener; + /** + * @var IUser|MockObject + */ + private $user; + + /** + * @var PostLoginEvent + */ + private $event; + public const UID = 'myuser'; public function setUp(): void { diff --git a/tests/Listener/UserDeletedTest.php b/tests/Listener/UserDeletedTest.php index b2a364ffd..693a982ea 100644 --- a/tests/Listener/UserDeletedTest.php +++ b/tests/Listener/UserDeletedTest.php @@ -53,6 +53,11 @@ class UserDeletedTest extends TestCase { */ private $listener; + /** + * @var IUser|MockObject + */ + private $user; + public const UID = 'myuser'; public function setUp(): void {