Skip to content
Snippets Groups Projects
Commit 5ba34ff4 authored by Steinwender, Tamara's avatar Steinwender, Tamara
Browse files

Fix rename bugs

parent 3a4a171b
No related branches found
No related tags found
No related merge requests found
Pipeline #205156 failed
......@@ -5,7 +5,7 @@ declare(strict_types=1);
namespace Dbp\Relay\BlobConnectorFilesystemBundle\Controller;
use Dbp\Relay\BlobBundle\Service\BlobService;
use Dbp\Relay\BlobConnectorFilesystemBundle\Service\SharedFileService;
use Dbp\Relay\BlobConnectorFilesystemBundle\Service\ShareLinkPersistenceService;
use Dbp\Relay\CoreBundle\Exception\ApiError;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
......@@ -16,18 +16,18 @@ use Symfony\Component\Mime\FileinfoMimeTypeGuesser;
class DownloadFileController extends AbstractController
{
/**
* @var SharedFileService
* @var ShareLinkPersistenceService
*/
private $sharedFileService;
private $shareLinkPersistenceService;
/**
* @var BlobService
*/
private $blobService;
public function __construct(SharedFileService $sharedFileService, BlobService $blobService)
public function __construct(ShareLinkPersistenceService $shareLinkPersistenceService, BlobService $blobService)
{
$this->sharedFileService = $sharedFileService;
$this->shareLinkPersistenceService = $shareLinkPersistenceService;
$this->blobService = $blobService;
}
......@@ -37,7 +37,7 @@ class DownloadFileController extends AbstractController
throw ApiError::withDetails(Response::HTTP_BAD_REQUEST, 'No identifier set', 'blobConnectorFilesystem:no-identifier-set');
}
$sharedLinkPersistence = $this->sharedFileService->getShareLinkPersistence($identifier);
$sharedLinkPersistence = $this->shareLinkPersistenceService->getShareLinkPersistence($identifier);
if (!$sharedLinkPersistence) {
throw ApiError::withDetails(Response::HTTP_BAD_REQUEST, 'No file with this share id found', 'blobConnectorFilesystem:download-file');
}
......
......@@ -5,14 +5,14 @@ declare(strict_types=1);
namespace Dbp\Relay\BlobConnectorFilesystemBundle\Tests\Service;
use Dbp\Relay\BlobConnectorFilesystemBundle\Entity\ShareLinkPersistence;
use Dbp\Relay\BlobConnectorFilesystemBundle\Service\SharedFileService;
use Dbp\Relay\BlobConnectorFilesystemBundle\Service\ShareLinkPersistenceService;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\UnderscoreNamingStrategy;
use Doctrine\ORM\ORMSetup;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\Uid\Uuid;
class SharedFileServiceTest extends WebTestCase
class ShareLinkPersistenceServiceTest extends WebTestCase
{
private $api;
......@@ -33,10 +33,10 @@ class SharedFileServiceTest extends WebTestCase
file_data_identifier varchar(255) NOT NULL,
filesystem_path varchar(255) NOT NULL, PRIMARY KEY(identifier))');
$this->api = new SharedFileService($em);
$this->api = new ShareLinkPersistenceService($em);
}
public function testCreateSharedLinkPersistence()
public function testCreateShareLinkPersistence()
{
$shareLinkId = (string) Uuid::v4();
$shareLinkPersistence = new ShareLinkPersistence();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment