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

Adapt test

parent e9e6c78b
Branches
No related tags found
No related merge requests found
Pipeline #207166 failed
......@@ -12,8 +12,10 @@ use Dbp\Relay\BlobConnectorFilesystemBundle\Service\ConfigurationService;
use Dbp\Relay\BlobConnectorFilesystemBundle\Service\FilesystemService;
use Dbp\Relay\BlobConnectorFilesystemBundle\Service\ShareLinkPersistenceService;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Mapping\UnderscoreNamingStrategy;
use Doctrine\ORM\ORMSetup;
use Doctrine\Persistence\ManagerRegistry;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\String\Slugger\AsciiSlugger;
......@@ -53,7 +55,10 @@ class FilesystemServiceTest extends WebTestCase
file_data_identifier varchar(255) NOT NULL,
filesystem_path varchar(255) NOT NULL, PRIMARY KEY(identifier))');
$this->shareLinkPersistenceService = new ShareLinkPersistenceService($em);
$managerRegistry = $this->createMock(ManagerRegistry::class);
$managerRegistry->expects($this->any())->method('getManager')->willReturn($em);
$this->shareLinkPersistenceService = new ShareLinkPersistenceService($managerRegistry);
$config = ['path' => dirname(__FILE__), 'link_url' => 'http://localhost:8000/', 'link_expire_time' => 'P7D'];
$this->configurationService = new ConfigurationService();
......
......@@ -9,6 +9,7 @@ use Dbp\Relay\BlobConnectorFilesystemBundle\Service\ShareLinkPersistenceService;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\UnderscoreNamingStrategy;
use Doctrine\ORM\ORMSetup;
use Doctrine\Persistence\ManagerRegistry;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\Uid\Uuid;
......@@ -33,7 +34,10 @@ class ShareLinkPersistenceServiceTest extends WebTestCase
file_data_identifier varchar(255) NOT NULL,
filesystem_path varchar(255) NOT NULL, PRIMARY KEY(identifier))');
$this->api = new ShareLinkPersistenceService($em);
$managerRegistry = $this->createMock(ManagerRegistry::class);
$managerRegistry->expects($this->any())->method('getManager')->willReturn($em);
$this->api = new ShareLinkPersistenceService($managerRegistry);
}
public function testCreateShareLinkPersistence()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment