File tree Expand file tree Collapse file tree 3 files changed +11
-23
lines changed Expand file tree Collapse file tree 3 files changed +11
-23
lines changed Original file line number Diff line number Diff line change 55namespace Vectorial1024 \LaravelProcessAsync ;
66
77use Closure ;
8- use Illuminate \Process \InvokedProcess ;
9- use Illuminate \Support \Facades \Process ;
10- use Illuminate \Support \Str ;
11- use InvalidArgumentException ;
12- use LogicException ;
13- use loophp \phposinfo \OsInfo ;
14- use RuntimeException ;
15-
16- use function Opis \Closure \{serialize , unserialize };
178
189/**
1910 * The fake AsyncTask class for testing.
Original file line number Diff line number Diff line change 44
55namespace Vectorial1024 \LaravelProcessAsync ;
66
7- use InvalidArgumentException ;
8- use loophp \phposinfo \OsInfo ;
9- use RuntimeException ;
10-
117/**
128 * The fake AsyncTaskStatus class for testing. Fake async tasks are presumed to be running by default.
139 */
@@ -32,5 +28,14 @@ public function isRunning(): bool
3228 return $ this ->fakeIsRunning ;
3329 }
3430
35-
31+ /**
32+ * Force the fake task to become stopped.
33+ *
34+ * Note: once stopped, the fake async task cannot be made running again. Use a new status object if the fake task needs to be restarted.
35+ * @return void
36+ */
37+ public function fakeStopRunning (): void
38+ {
39+ $ this ->fakeIsRunning = false ;
40+ }
3641}
Original file line number Diff line number Diff line change 22
33namespace Vectorial1024 \LaravelProcessAsync \Tests ;
44
5- use InvalidArgumentException ;
6- use LogicException ;
7- use RuntimeException ;
85use Vectorial1024 \LaravelProcessAsync \AsyncTask ;
96use Vectorial1024 \LaravelProcessAsync \AsyncTaskStatus ;
10- use Vectorial1024 \LaravelProcessAsync \FakeAsyncTaskStatus ;
117use Vectorial1024 \LaravelProcessAsync \Tests \Tasks \DummyAsyncTask ;
12- use Vectorial1024 \LaravelProcessAsync \Tests \Tasks \SleepingAsyncTask ;
13- use Vectorial1024 \LaravelProcessAsync \Tests \Tasks \TestTimeoutENoticeTask ;
14- use Vectorial1024 \LaravelProcessAsync \Tests \Tasks \TestTimeoutErrorTask ;
15- use Vectorial1024 \LaravelProcessAsync \Tests \Tasks \TestTimeoutNoOpTask ;
16- use Vectorial1024 \LaravelProcessAsync \Tests \Tasks \TestTimeoutNormalTask ;
8+ use Vectorial1024 \LaravelProcessAsync \FakeAsyncTaskStatus ;
179
1810// a series of tests that ensure the fake tasks are indeed fake while still look like the same
1911class FakeAsyncTaskTest extends BaseTestCase
You can’t perform that action at this time.
0 commit comments