Let ConvertController return a pdf file directly without trying to converting it

Those changes improve performance when the file is already in pdf format.
This commit is contained in:
2024-11-14 08:49:26 +01:00
parent f90fae4e14
commit 9b661c3b8f
2 changed files with 13 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\WopiBundle\Tests\Controller;
use Chill\DocStoreBundle\Entity\StoredObject;
use Chill\DocStoreBundle\Security\Authorization\StoredObjectRoleEnum;
use Chill\DocStoreBundle\Service\StoredObjectManagerInterface;
use Chill\WopiBundle\Controller\ConvertController;
use Chill\WopiBundle\Service\WopiConverter;
@@ -37,6 +38,7 @@ final class ConvertControllerTest extends TestCase
$security = $this->prophesize(Security::class);
$security->isGranted('ROLE_USER')->willReturn(true);
$security->isGranted(StoredObjectRoleEnum::SEE->value, $storedObject)->willReturn(true);
$storeManager = $this->prophesize(StoredObjectManagerInterface::class);
$storeManager->read($storedObject)->willReturn('content');
@@ -67,6 +69,7 @@ final class ConvertControllerTest extends TestCase
$security = $this->prophesize(Security::class);
$security->isGranted('ROLE_USER')->willReturn(true);
$security->isGranted(StoredObjectRoleEnum::SEE->value, $storedObject)->willReturn(true);
$storeManager = $this->prophesize(StoredObjectManagerInterface::class);
$storeManager->read($storedObject)->willReturn('content');