diff --git a/tests/CurrentUserTest.php b/tests/CurrentUserTest.php index f204eb3bb..7f721e436 100644 --- a/tests/CurrentUserTest.php +++ b/tests/CurrentUserTest.php @@ -24,11 +24,11 @@ use OCA\Activity\CurrentUser; use OCP\IRequest; use OCP\IUser; +use OCP\IUserSession; use OCP\Share\Exceptions\ShareNotFound; use OCP\Share\IShare; -use PHPUnit\Framework\MockObject\MockObject; -use OCP\IUserSession; use OCP\Share\IManager; +use PHPUnit\Framework\MockObject\MockObject; /** * Class CurrentUserTest @@ -45,15 +45,12 @@ class CurrentUserTest extends TestCase { /** @var IManager|MockObject */ protected $shareManager; - /** - * - */ - protected function setUp(): void { parent::setUp(); $this->request = $this->getMockBuilder(IRequest::class) ->disableOriginalConstructor() + ->addMethods(['__get']) ->getMock(); $this->userSession = $this->createMock(IUserSession::class); $this->shareManager = $this->createMock(IManager::class); @@ -189,7 +186,7 @@ public function dataGetCloudIDFromToken(): array { public function testGetCloudIDFromToken(array $server, $share, ?string $expected): void { $instance = $this->getInstance(); - $this->request->server = $server; + $this->request->method('__get')->with('server')->willReturn($server); if ($share === null) { $this->shareManager->expects($this->never())