Skip to content

Commit 649312f

Browse files
authored
Get fresh status (laravel-workflow#149)
1 parent 2c8dbe6 commit 649312f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/WorkflowStub.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ public function fresh(): static
226226

227227
public function resume(): void
228228
{
229-
$this->dispatch();
229+
$this->fresh()
230+
->dispatch();
230231
}
231232

232233
public function start(...$arguments): void

tests/Unit/WorkflowFakerTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Tests\Unit;
66

7-
use Illuminate\Support\Carbon;
87
use Tests\Fixtures\TestActivity;
98
use Tests\Fixtures\TestChildWorkflow;
109
use Tests\Fixtures\TestConcurrentWorkflow;
@@ -18,9 +17,6 @@ final class WorkflowFakerTest extends TestCase
1817
{
1918
public function testTimeTravelWorkflow(): void
2019
{
21-
$now = Carbon::now();
22-
Carbon::setTestNow($now);
23-
2420
WorkflowStub::fake();
2521

2622
WorkflowStub::mock(TestActivity::class, 'activity');
@@ -38,7 +34,9 @@ public function testTimeTravelWorkflow(): void
3834

3935
$workflow->cancel();
4036

41-
Carbon::setTestNow($now->copy()->addSeconds(300));
37+
$this->travel(5)
38+
->minutes();
39+
4240
$workflow->resume();
4341

4442
$this->assertTrue($workflow->isCanceled());

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy