mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-04 05:44:58 +00:00
Update DropFile to handle object versioning
This commit is contained in:
@@ -13,6 +13,7 @@ namespace Chill\DocStoreBundle\Tests\Controller;
|
||||
|
||||
use Chill\DocStoreBundle\Controller\WebdavController;
|
||||
use Chill\DocStoreBundle\Entity\StoredObject;
|
||||
use Chill\DocStoreBundle\Entity\StoredObjectVersion;
|
||||
use Chill\DocStoreBundle\Service\StoredObjectManagerInterface;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Prophecy\Argument;
|
||||
@@ -417,30 +418,32 @@ class WebdavControllerTest extends KernelTestCase
|
||||
|
||||
class MockedStoredObjectManager implements StoredObjectManagerInterface
|
||||
{
|
||||
public function getLastModified(StoredObject|\Chill\DocStoreBundle\Entity\StoredObjectVersion $document): \DateTimeInterface
|
||||
public function getLastModified(StoredObject|StoredObjectVersion $document): \DateTimeInterface
|
||||
{
|
||||
return new \DateTimeImmutable('2023-09-13T14:15', new \DateTimeZone('+02:00'));
|
||||
}
|
||||
|
||||
public function getContentLength(StoredObject|\Chill\DocStoreBundle\Entity\StoredObjectVersion $document): int
|
||||
public function getContentLength(StoredObject|StoredObjectVersion $document): int
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
|
||||
public function read(StoredObject|\Chill\DocStoreBundle\Entity\StoredObjectVersion $document): string
|
||||
public function read(StoredObject|StoredObjectVersion $document): string
|
||||
{
|
||||
return 'abcde';
|
||||
}
|
||||
|
||||
public function write(StoredObject $document, string $clearContent, ?string $contentType = null): \Chill\DocStoreBundle\Entity\StoredObjectVersion
|
||||
public function write(StoredObject $document, string $clearContent, ?string $contentType = null): StoredObjectVersion
|
||||
{
|
||||
return $document->registerVersion();
|
||||
}
|
||||
|
||||
public function etag(StoredObject|\Chill\DocStoreBundle\Entity\StoredObjectVersion $document): string
|
||||
public function etag(StoredObject|StoredObjectVersion $document): string
|
||||
{
|
||||
return 'ab56b4d92b40713acc5af89985d4b786';
|
||||
}
|
||||
|
||||
public function clearCache(): void {}
|
||||
|
||||
public function delete(StoredObjectVersion $storedObjectVersion): void {}
|
||||
}
|
||||
|
Reference in New Issue
Block a user