You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,6 +129,36 @@ You may need to clear your Laravel optimisation cache after changing this value.
129
129
130
130
The contents of the async tasks will be signed by this secret key, so that this library can know whether the tasks are started by this library itself or someone else.
131
131
132
+
### Fake Objects
133
+
Fake objects are available for users to simulate async task behaviors without actually starting async tasks. This should be helpful when writing tests that attempts to react to task statuses.
134
+
135
+
The following fake objects are available:
136
+
137
+
-`FakeAsyncTask`: a fake of `AsyncTask`
138
+
-`FakeAsyncTaskStatus`: a fake of `AsyncTaskStatus`
139
+
140
+
Notably, they can be used like this:
141
+
142
+
```php
143
+
// you may obtain the task status in the usual way...
144
+
$fakeTask = new FakeAsyncTask(/* ... */, taskID: "TestingTask");
145
+
$fakeStatus = $fakeTask->start();
146
+
147
+
// ...or just construct it directly
148
+
$fakeStatusDirect = new FakeAsyncTaskStatus("TestingTask");
0 commit comments