Skip to content

Commit 349aa8e

Browse files
committed
unify mock creation of LoggerInterface in tests
Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
1 parent dbf4038 commit 349aa8e

8 files changed

Lines changed: 7 additions & 8 deletions

File tree

tests/Unit/Activity/ProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function setUp(): void {
6767
$this->formMapper = $this->createMock(FormMapper::class);
6868
$this->eventMerger = $this->createMock(IEventMerger::class);
6969
$this->groupManager = $this->createMock(IGroupManager::class);
70-
$this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
70+
$this->logger = $this->createMock(LoggerInterface::class);
7171
$this->urlGenerator = $this->createMock(IURLGenerator::class);
7272
$this->userManager = $this->createMock(IUserManager::class);
7373
$this->l10nFactory = $this->createMock(IFactory::class);

tests/Unit/BackgroundJob/CleanupUploadedFilesJobTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function setUp(): void {
4040
$this->formMapper = $this->createMock(FormMapper::class);
4141
$this->uploadedFileMapper = $this->createMock(UploadedFileMapper::class);
4242
$time = $this->createMock(ITimeFactory::class);
43-
$this->logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
43+
$this->logger = $this->createMock(LoggerInterface::class);
4444
$this->cleanupUploadedFilesJob = new CleanupUploadedFilesJob(
4545
$this->rootFolder,
4646
$this->formMapper,

tests/Unit/BackgroundJob/UserDeletedJobTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function setUp(): void {
3131
parent::setUp();
3232
$this->formMapper = $this->createMock(FormMapper::class);
3333
$time = $this->createMock(ITimeFactory::class);
34-
$this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
34+
$this->logger = $this->createMock(LoggerInterface::class);
3535
$this->userDeletedJob = new UserDeletedJob($this->formMapper, $time, $this->logger);
3636
}
3737

tests/Unit/Controller/ConfigControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function setUp(): void {
4141

4242
$this->configService = $this->createMock(ConfigService::class);
4343
$this->config = $this->createMock(IConfig::class);
44-
$this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
44+
$this->logger = $this->createMock(LoggerInterface::class);
4545
$this->request = $this->createMock(IRequest::class);
4646

4747
$this->configController = new ConfigController(

tests/Unit/Controller/ShareApiControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function setUp(): void {
9595
$this->configService = $this->createMock(ConfigService::class);
9696
$this->formsService = $this->createMock(FormsService::class);
9797
$this->groupManager = $this->createMock(IGroupManager::class);
98-
$this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
98+
$this->logger = $this->createMock(LoggerInterface::class);
9999
$this->request = $this->createMock(IRequest::class);
100100
$this->userManager = $this->createMock(IUserManager::class);
101101
$userSession = $this->createMock(IUserSession::class);

tests/Unit/Listener/UserDeletedListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class UserDeletedListenerTest extends TestCase {
3232
public function setUp(): void {
3333
parent::setUp();
3434
$this->jobList = $this->createMock(IJobList::class);
35-
$this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
35+
$this->logger = $this->createMock(LoggerInterface::class);
3636
$this->userDeletedListener = new UserDeletedListener($this->jobList, $this->logger);
3737
}
3838

tests/Unit/Service/FormsServiceTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ public function setUp(): void {
124124
$this->userManager = $this->createMock(IUserManager::class);
125125
$this->secureRandom = $this->createMock(ISecureRandom::class);
126126
$this->circlesService = $this->createMock(CirclesService::class);
127-
$this->logger = $this->createMock(LoggerInterface::class);
128127
$userSession = $this->createMock(IUserSession::class);
129128

130129
$user = $this->createMock(IUser::class);

tests/Unit/Service/SubmissionServiceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function setUp(): void {
9393
$this->storage = $this->createMock(IRootFolder::class);
9494
$this->config = $this->createMock(IConfig::class);
9595
$this->l10n = $this->createMock(IL10N::class);
96-
$this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
96+
$this->logger = $this->createMock(LoggerInterface::class);
9797
$this->mailer = $this->getMockBuilder(IMailer::class)->getMock();
9898
$this->userManager = $this->createMock(IUserManager::class);
9999
$userSession = $this->createMock(IUserSession::class);

0 commit comments

Comments
 (0)