use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Http\FileDisplayResponse;
+use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Constants;
use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IManager;
use OCP\Share\IShare;
+use PHPUnit\Framework\MockObject\MockObject;
use Punic\Data;
use Test\TestCase;
/** @var IPreview|\PHPUnit_Framework_MockObject_MockObject */
private $previewManager;
-
/** @var IManager|\PHPUnit_Framework_MockObject_MockObject */
private $shareManager;
+ /** @var ITimeFactory|MockObject */
+ private $timeFactory;
/** @var PublicPreviewController */
private $controller;
$this->previewManager = $this->createMock(IPreview::class);
$this->shareManager = $this->createMock(IManager::class);
+ $this->timeFactory = $this->createMock(ITimeFactory::class);
+
+ $this->timeFactory->method('getTime')
+ ->willReturn(1337);
+
+ $this->overwriteService(ITimeFactory::class, $this->timeFactory);
$this->controller = new PublicPreviewController(
'files_sharing',