Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Jan 16, 2024
1 parent 24f2805 commit 4b8cda4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/CurrentUserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down Expand Up @@ -189,7 +186,10 @@ public function dataGetCloudIDFromToken(): array {
public function testGetCloudIDFromToken(array $server, $share, ?string $expected): void {
$instance = $this->getInstance();

$this->request->server = $server;
$this->request->method('__get')->willReturnCallback(fn (string $prop) => match ($prop) {
'server' => $server,
default => null,
});

if ($share === null) {
$this->shareManager->expects($this->never())
Expand Down

0 comments on commit 4b8cda4

Please sign in to comment.