|
|
@@ -49,7 +49,6 @@ class SubdomainServiceTest extends TestCase
|
|
|
{
|
|
|
private SubdomainRepository $subdomainRepository;
|
|
|
private OrganizationUtils $organizationUtils;
|
|
|
- private Security $security;
|
|
|
private BindFileService $bindFileService;
|
|
|
private MessageBusInterface $messageBus;
|
|
|
private EntityManagerInterface $entityManager;
|
|
|
@@ -60,7 +59,6 @@ class SubdomainServiceTest extends TestCase
|
|
|
$this->subdomainRepository = $this->getMockBuilder(SubdomainRepository::class)->disableOriginalConstructor()->getMock();
|
|
|
$this->entityManager = $this->getMockBuilder(EntityManagerInterface::class)->disableOriginalConstructor()->getMock();
|
|
|
$this->messageBus = $this->getMockBuilder(MessageBusInterface::class)->disableOriginalConstructor()->getMock();
|
|
|
- $this->security = $this->getMockBuilder(Security::class)->disableOriginalConstructor()->getMock();
|
|
|
$this->organizationUtils = $this->getMockBuilder(OrganizationUtils::class)->disableOriginalConstructor()->getMock();
|
|
|
$this->bindFileService = $this->getMockBuilder(BindFileService::class)->disableOriginalConstructor()->getMock();
|
|
|
$this->accessRepository = $this->getMockBuilder(AccessRepository::class)->disableOriginalConstructor()->getMock();
|
|
|
@@ -72,7 +70,6 @@ class SubdomainServiceTest extends TestCase
|
|
|
$this->subdomainRepository,
|
|
|
$this->entityManager,
|
|
|
$this->messageBus,
|
|
|
- $this->security,
|
|
|
$this->organizationUtils,
|
|
|
$this->bindFileService,
|
|
|
$this->accessRepository
|
|
|
@@ -351,8 +348,8 @@ class SubdomainServiceTest extends TestCase
|
|
|
$subdomain = $this->getMockBuilder(Subdomain::class)->getMock();
|
|
|
|
|
|
$this->accessRepository
|
|
|
- ->method('findOneBy')
|
|
|
- ->with(['adminAccess' => 1, 'organization' => $organization])
|
|
|
+ ->method('findAdminAccess')
|
|
|
+ ->with($organization)
|
|
|
->willReturn($access);
|
|
|
|
|
|
$subdomain->method('getSubdomain')->willReturn('sub');
|
|
|
@@ -387,9 +384,6 @@ class SubdomainServiceTest extends TestCase
|
|
|
|
|
|
$access = $this->getMockBuilder(Access::class)->getMock();
|
|
|
$access->method('getId')->willReturn(1);
|
|
|
- $this->security
|
|
|
- ->method('getUser')
|
|
|
- ->willReturn($access);
|
|
|
|
|
|
$organization = $this->getMockBuilder(Organization::class)->getMock();
|
|
|
$organization->method('getId')->willReturn(1);
|
|
|
@@ -398,6 +392,11 @@ class SubdomainServiceTest extends TestCase
|
|
|
$subdomain->method('getOrganization')->willReturn($organization);
|
|
|
$subdomain->method('getId')->willReturn(1);
|
|
|
|
|
|
+ $this->accessRepository
|
|
|
+ ->method('findAdminAccess')
|
|
|
+ ->with($organization)
|
|
|
+ ->willReturn($access);
|
|
|
+
|
|
|
$this->organizationUtils
|
|
|
->expects(self::once())
|
|
|
->method('getOrganizationWebsite')
|