|
32 | 32 | });
|
33 | 33 |
|
34 | 34 | it('can start a php command', function () {
|
35 |
| - ChildProcess::artisan("-r 'sleep(5);'", 'some-alias', ['baz' => 'zah']); |
| 35 | + ChildProcess::php("-r 'sleep(5);'", 'some-alias', ['baz' => 'zah']); |
36 | 36 |
|
37 | 37 | Http::assertSent(function (Request $request) {
|
38 | 38 | return $request->url() === 'http://localhost:4000/api/child-process/start' &&
|
|
41 | 41 | $request['cwd'] === base_path() &&
|
42 | 42 | $request['env'] === ['baz' => 'zah'];
|
43 | 43 | });
|
44 |
| -})->todo(); |
| 44 | +}); |
45 | 45 |
|
46 | 46 | it('can start a artisan command', function () {
|
47 |
| - ChildProcess::artisan('foo:bar', 'some-alias', ['baz' => 'zah']); |
| 47 | + ChildProcess::artisan('foo:bar --verbose', 'some-alias', ['baz' => 'zah']); |
48 | 48 |
|
49 | 49 | Http::assertSent(function (Request $request) {
|
50 | 50 | return $request->url() === 'http://localhost:4000/api/child-process/start' &&
|
51 | 51 | $request['alias'] === 'some-alias' &&
|
52 |
| - $request['cmd'] === [PHP_BINARY, 'artisan', 'foo:bar'] && |
| 52 | + $request['cmd'] === [PHP_BINARY, 'artisan', 'foo:bar', '--verbose'] && |
53 | 53 | $request['cwd'] === base_path() &&
|
54 | 54 | $request['env'] === ['baz' => 'zah'];
|
55 | 55 | });
|
|
64 | 64 | });
|
65 | 65 |
|
66 | 66 | it('accepts either a string or a array as php command argument', function () {
|
67 |
| - ChildProcess::artisan(" 'sleep(5);'", 'some-alias'); |
| 67 | + ChildProcess::php("-r 'sleep(5);'", 'some-alias'); |
68 | 68 | Http::assertSent(fn (Request $request) => $request['cmd'] === [PHP_BINARY, '-r', "'sleep(5);'"]);
|
69 | 69 |
|
70 | 70 | ChildProcess::artisan(['-r', "'sleep(5);'"], 'some-alias');
|
71 | 71 | Http::assertSent(fn (Request $request) => $request['cmd'] === [PHP_BINARY, '-r', "'sleep(5);'"]);
|
72 |
| -})->todo(); |
| 72 | +}); |
73 | 73 |
|
74 | 74 | it('accepts either a string or a array as artisan command argument', function () {
|
75 | 75 | ChildProcess::artisan('foo:bar', 'some-alias');
|
|
119 | 119 | it('can mark a php command as persistent', function () {
|
120 | 120 | ChildProcess::php("-r 'sleep(5);'", 'some-alias', persistent: true);
|
121 | 121 | Http::assertSent(fn (Request $request) => $request['persistent'] === true);
|
122 |
| -})->todo(); |
| 122 | +}); |
123 | 123 |
|
124 | 124 | it('can mark a artisan command as persistent', function () {
|
125 | 125 | ChildProcess::artisan('foo:bar', 'some-alias', persistent: true);
|
|
0 commit comments