浏览代码

restore tests

Olivier Massot 2 年之前
父节点
当前提交
1ab7f8d0e7
共有 1 个文件被更改,包括 7 次插入8 次删除
  1. 7 8
      tests/Service/Typo3/SubdomainServiceTest.php

+ 7 - 8
tests/Service/Typo3/SubdomainServiceTest.php

@@ -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')