From 6bf7cb6982a9000069011b6c8411d66dc8ae9848 Mon Sep 17 00:00:00 2001 From: Kai Sassnowski Date: Mon, 25 Mar 2024 09:18:55 +0100 Subject: [PATCH] fix broken tests --- tests/VentureServiceProviderTest.php | 1 + tests/WorkflowDefinitionTest.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/VentureServiceProviderTest.php b/tests/VentureServiceProviderTest.php index 618c6f9..5bdd6b4 100644 --- a/tests/VentureServiceProviderTest.php +++ b/tests/VentureServiceProviderTest.php @@ -24,6 +24,7 @@ $eventSubscriberMock = m::spy(WorkflowEventSubscriber::class); app()->instance(WorkflowEventSubscriber::class, $eventSubscriberMock); $jobMock = m::mock(Job::class); + $jobMock->allows('payload')->andReturnNull(); event(new JobProcessed('::connection::', $jobMock)); $eventSubscriberMock->shouldHaveReceived('handleJobProcessed'); diff --git a/tests/WorkflowDefinitionTest.php b/tests/WorkflowDefinitionTest.php index 3adaadf..302cd8e 100644 --- a/tests/WorkflowDefinitionTest.php +++ b/tests/WorkflowDefinitionTest.php @@ -510,20 +510,20 @@ public function definition(): WorkflowDefinition assertEquals($expected, $definition->hasWorkflow(NestedWorkflow::class, $dependencies)); })->with([ 'has workflow, ignore dependencies' => [ - 'configureWorkflow' => fn () => function (WorkflowDefinition $definition): void { + 'configureWorkflow' => function (WorkflowDefinition $definition): void { $definition->addWorkflow(new NestedWorkflow()); }, 'dependencies' => null, 'expected' => true, ], 'does not have workflow, ignore dependencies' => [ - 'configureWorkflow' => fn () => function (WorkflowDefinition $definition): void { + 'configureWorkflow' => function (WorkflowDefinition $definition): void { }, 'dependencies' => null, 'expected' => false, ], 'has workflow, incorrect dependencies' => [ - 'configureWorkflow' => fn () => function (WorkflowDefinition $definition): void { + 'configureWorkflow' => function (WorkflowDefinition $definition): void { $definition ->addWorkflow(new NestedWorkflow()); }, @@ -531,7 +531,7 @@ public function definition(): WorkflowDefinition 'expected' => false, ], 'has workflow, correct dependencies' => [ - 'configureWorkflow' => fn () => function (WorkflowDefinition $definition): void { + 'configureWorkflow' => function (WorkflowDefinition $definition): void { $definition ->addJob(new TestJob1()) ->addWorkflow(new NestedWorkflow(), [TestJob1::class]);