Skip to content

Commit 0d987dd

Browse files
committed
Fix tests in files_versions
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
1 parent 229bfcb commit 0d987dd

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

apps/files_versions/tests/Controller/PreviewControllerTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ protected function setUp(): void {
7373
$user->expects($this->any())
7474
->method('getUID')
7575
->willReturn($this->userId);
76-
$this->mimeTypeDetector = $this->createMock(IMimeTypeDetector::class);
7776
$this->previewManager = $this->createMock(IPreview::class);
7877
$this->userSession = $this->createMock(IUserSession::class);
7978
$this->userSession->expects($this->any())
@@ -86,7 +85,6 @@ protected function setUp(): void {
8685
$this->createMock(IRequest::class),
8786
$this->rootFolder,
8887
$this->userSession,
89-
$this->mimeTypeDetector,
9088
$this->versionManager,
9189
$this->previewManager
9290
);
@@ -170,10 +168,6 @@ public function testVersionNotFound() {
170168
->with('file')
171169
->willReturn($sourceFile);
172170

173-
$this->mimeTypeDetector->method('detectPath')
174-
->with($this->equalTo('file'))
175-
->willReturn('myMime');
176-
177171
$this->versionManager->method('getVersionFile')
178172
->willThrowException(new NotFoundException());
179173

apps/files_versions/tests/ExpirationTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
use OCP\AppFramework\Utility\ITimeFactory;
3030
use OCP\IConfig;
3131
use PHPUnit\Framework\MockObject\MockObject;
32+
use Psr\Log\LoggerInterface;
3233

3334
class ExpirationTest extends \Test\TestCase {
3435
public const SECONDS_PER_DAY = 86400; //60*60*24
@@ -109,8 +110,9 @@ public function expirationData() {
109110
public function testExpiration($retentionObligation, $timeNow, $timestamp, $quotaExceeded, $expectedResult) {
110111
$mockedConfig = $this->getMockedConfig($retentionObligation);
111112
$mockedTimeFactory = $this->getMockedTimeFactory($timeNow);
113+
$mockedLogger = $this->createMock(LoggerInterface::class);
112114

113-
$expiration = new Expiration($mockedConfig, $mockedTimeFactory);
115+
$expiration = new Expiration($mockedConfig, $mockedTimeFactory, $mockedLogger);
114116
$actualResult = $expiration->isExpired($timestamp, $quotaExceeded);
115117

116118
$this->assertEquals($expectedResult, $actualResult);

0 commit comments

Comments
 (0)