Skip to content

Commit 3af4ca2

Browse files
committed
Create the FakeAsyncTaskStatus class
1 parent dac44e9 commit 3af4ca2

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

src/FakeAsyncTaskStatus.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Vectorial1024\LaravelProcessAsync;
6+
7+
use InvalidArgumentException;
8+
use loophp\phposinfo\OsInfo;
9+
use RuntimeException;
10+
11+
/**
12+
* The fake AsyncTaskStatus class for testing. Fake async tasks are presumed to be running by default.
13+
*/
14+
class FakeAsyncTaskStatus extends AsyncTaskStatus
15+
{
16+
private bool $fakeIsRunning = true;
17+
18+
/**
19+
* Constructs a fake status object. Fake async tasks are presumed to be running by default.
20+
* @param string $fakeTaskID The task ID of the fake async task.
21+
*/
22+
public function __construct(string $fakeTaskID) {
23+
parent::__construct($fakeTaskID);
24+
}
25+
26+
/**
27+
* Returns whether the fake task is currently "running".
28+
* @return bool The faked "task is running" status.
29+
*/
30+
public function isRunning(): bool
31+
{
32+
return $this->fakeIsRunning;
33+
}
34+
35+
36+
}

0 commit comments

Comments
 (0)