From f48ea1fdd2e6fb118e00349548dae5fd59d16728 Mon Sep 17 00:00:00 2001 From: marcelmanzel Date: Mon, 12 Aug 2024 13:26:51 +0200 Subject: [PATCH] OXDEV-8216: Refactor some DataProviders --- .../Service/ModuleActivationsServiceTest.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/tests/Unit/Module/Service/ModuleActivationsServiceTest.php b/tests/Unit/Module/Service/ModuleActivationsServiceTest.php index 541a079..8a96b39 100644 --- a/tests/Unit/Module/Service/ModuleActivationsServiceTest.php +++ b/tests/Unit/Module/Service/ModuleActivationsServiceTest.php @@ -26,16 +26,16 @@ class ModuleActivationsServiceTest extends UnitTestCase */ public function testModuleActivationAndDeactivation( string $method, - string $moduleId, - int $shopId ): void { + $shopId = 1; + $moduleId = uniqid(); $moduleActivationBridgeMock = $this->createMock(ModuleActivationBridgeInterface::class); $moduleActivationBridgeMock ->method($method) ->with($moduleId, $shopId); $sut = $this->getSut( - context: $this->getContextMock(), + context: $this->getContextMock($shopId), moduleActivationBridge: $moduleActivationBridgeMock ); @@ -49,10 +49,9 @@ public function testModuleActivationAndDeactivation( */ public function testModuleActivationAndDeactivationExceptions( string $method, - string $moduleId, mixed $exceptionClass ): void { - + $moduleId = uniqid(); $moduleActivationBridgeMock = $this->createMock(ModuleActivationBridgeInterface::class); $moduleActivationBridgeMock ->method($method) @@ -72,14 +71,10 @@ public static function activationDataProvider(): \Generator { yield 'test activate module' => [ 'method' => 'activate', - 'moduleId' => uniqid(), - 'shopId' => 1 ]; yield 'test deactivate module' => [ 'method' => 'deactivate', - 'moduleId' => uniqid(), - 'shopId' => 1 ]; } @@ -87,14 +82,12 @@ public static function exceptionDataProvider(): \Generator { yield 'test activate module throws exception' => [ 'method' => 'activate', - 'moduleId' => uniqid(), 'exceptionClass' => ModuleActivationException::class, ]; yield 'test deactivate module throws exception' => [ 'method' => 'deactivate', - 'moduleId' => uniqid(), 'exceptionClass' => ModuleDeactivationException::class, ];