From 0aa210a255eb745c81722548c65631311dad16df Mon Sep 17 00:00:00 2001 From: Anton Fedurtsya Date: Tue, 14 Nov 2023 18:33:44 +0200 Subject: [PATCH] OXDEV-7557 Fix phpcs reported issues Signed-off-by: Anton Fedurtsya --- .../Infrastructure/ChangeThemeSettingRepositoryTest.php | 4 ++-- tests/Unit/Infrastructure/ShopSettingRepositoryTest.php | 9 ++------- tests/Unit/Service/ThemeSettingServiceTest.php | 7 +++---- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/tests/Unit/Infrastructure/ChangeThemeSettingRepositoryTest.php b/tests/Unit/Infrastructure/ChangeThemeSettingRepositoryTest.php index 3a1ef8b..4a77e3e 100644 --- a/tests/Unit/Infrastructure/ChangeThemeSettingRepositoryTest.php +++ b/tests/Unit/Infrastructure/ChangeThemeSettingRepositoryTest.php @@ -36,7 +36,7 @@ public function testChangeThemeSettingInteger(): void ->method('saveSettingValue') ->with($nameID, 'awesomeTheme', '123'); - $repository->saveIntegerSetting($nameID, 123, 'awesomeTheme'); + $repository->saveIntegerSetting($nameID, 123, 'awesomeTheme'); } public function testChangeNoThemeSettingInteger(): void @@ -64,6 +64,6 @@ public function testChangeNoThemeSettingInteger(): void $this->expectException(NotFound::class); $this->expectExceptionMessage('The integer setting "' . $nameID->val() . '" doesn\'t exist'); - $repository->saveIntegerSetting($nameID, 123, 'awesomeTheme'); + $repository->saveIntegerSetting($nameID, 123, 'awesomeTheme'); } } diff --git a/tests/Unit/Infrastructure/ShopSettingRepositoryTest.php b/tests/Unit/Infrastructure/ShopSettingRepositoryTest.php index 466cb34..0119e99 100644 --- a/tests/Unit/Infrastructure/ShopSettingRepositoryTest.php +++ b/tests/Unit/Infrastructure/ShopSettingRepositoryTest.php @@ -264,14 +264,9 @@ private function getFetchOneShopSettingRepoInstance(string|bool $qbReturnValue): return $this->getShopSettingRepository($queryBuilderFactory); } - /** - * @param MockObject|QueryBuilderFactoryInterface $queryBuilderFactory - * @return ShopSettingRepository - */ private function getShopSettingRepository( - MockObject|QueryBuilderFactoryInterface $queryBuilderFactory - ): ShopSettingRepository - { + QueryBuilderFactoryInterface $queryBuilderFactory + ): ShopSettingRepository { $basicContextMock = $this->getBasicContextMock(1); $eventDispatcher = $this->createMock(EventDispatcherInterface::class); $shopSettingEncoder = new ShopSettingEncoder(); diff --git a/tests/Unit/Service/ThemeSettingServiceTest.php b/tests/Unit/Service/ThemeSettingServiceTest.php index 8577efd..116005b 100644 --- a/tests/Unit/Service/ThemeSettingServiceTest.php +++ b/tests/Unit/Service/ThemeSettingServiceTest.php @@ -314,14 +314,13 @@ public function testChangeThemeSettingCollection(): void $this->assertSame($value, $collectionSetting->getValue()); } - public function getSut( + private function getSut( ?ThemeSettingRepositoryInterface $themeSettingRepository = null, ?JsonServiceInterface $jsonService = null, ): ThemeSettingService { + $themeSettingRepository = $themeSettingRepository ?? $this->createStub(ThemeSettingRepositoryInterface::class); return new ThemeSettingService( - themeSettingRepository: $themeSettingRepository ?? $this->createStub( - ThemeSettingRepositoryInterface::class - ), + themeSettingRepository: $themeSettingRepository, jsonService: $jsonService ?? $this->createStub(JsonServiceInterface::class) ); }