mirror of
https://github.com/nextcloud/server.git
synced 2026-04-23 07:08:34 -04:00
Merge pull request #28132 from nextcloud/work/carl/fix-tests
Fix tests in files_versions
This commit is contained in:
commit
ece22815a3
2 changed files with 3 additions and 7 deletions
|
|
@ -73,7 +73,6 @@ class PreviewControllerTest extends TestCase {
|
|||
$user->expects($this->any())
|
||||
->method('getUID')
|
||||
->willReturn($this->userId);
|
||||
$this->mimeTypeDetector = $this->createMock(IMimeTypeDetector::class);
|
||||
$this->previewManager = $this->createMock(IPreview::class);
|
||||
$this->userSession = $this->createMock(IUserSession::class);
|
||||
$this->userSession->expects($this->any())
|
||||
|
|
@ -86,7 +85,6 @@ class PreviewControllerTest extends TestCase {
|
|||
$this->createMock(IRequest::class),
|
||||
$this->rootFolder,
|
||||
$this->userSession,
|
||||
$this->mimeTypeDetector,
|
||||
$this->versionManager,
|
||||
$this->previewManager
|
||||
);
|
||||
|
|
@ -170,10 +168,6 @@ class PreviewControllerTest extends TestCase {
|
|||
->with('file')
|
||||
->willReturn($sourceFile);
|
||||
|
||||
$this->mimeTypeDetector->method('detectPath')
|
||||
->with($this->equalTo('file'))
|
||||
->willReturn('myMime');
|
||||
|
||||
$this->versionManager->method('getVersionFile')
|
||||
->willThrowException(new NotFoundException());
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ use OCA\Files_Versions\Expiration;
|
|||
use OCP\AppFramework\Utility\ITimeFactory;
|
||||
use OCP\IConfig;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class ExpirationTest extends \Test\TestCase {
|
||||
public const SECONDS_PER_DAY = 86400; //60*60*24
|
||||
|
|
@ -109,8 +110,9 @@ class ExpirationTest extends \Test\TestCase {
|
|||
public function testExpiration($retentionObligation, $timeNow, $timestamp, $quotaExceeded, $expectedResult) {
|
||||
$mockedConfig = $this->getMockedConfig($retentionObligation);
|
||||
$mockedTimeFactory = $this->getMockedTimeFactory($timeNow);
|
||||
$mockedLogger = $this->createMock(LoggerInterface::class);
|
||||
|
||||
$expiration = new Expiration($mockedConfig, $mockedTimeFactory);
|
||||
$expiration = new Expiration($mockedConfig, $mockedTimeFactory, $mockedLogger);
|
||||
$actualResult = $expiration->isExpired($timestamp, $quotaExceeded);
|
||||
|
||||
$this->assertEquals($expectedResult, $actualResult);
|
||||
|
|
|
|||
Loading…
Reference in a new issue