|
26 | 26 | Http::assertSent(function (Request $request) {
|
27 | 27 | return $request->url() === 'http://localhost:4000/api/child-process/start' &&
|
28 | 28 | $request['alias'] === 'some-alias' &&
|
29 |
| - $request['cmd'] === [str_replace(' ', '\ ', PHP_BINARY), 'artisan', 'foo:bar'] && |
| 29 | + $request['cmd'] === [PHP_BINARY, 'artisan', 'foo:bar'] && |
30 | 30 | $request['cwd'] === base_path() &&
|
31 | 31 | $request['env'] === ['baz' => 'zah'];
|
32 | 32 | });
|
|
44 | 44 |
|
45 | 45 | it('accepts either a string or a array as artisan command argument', function () {
|
46 | 46 | ChildProcess::artisan('foo:bar', 'some-alias');
|
47 |
| - Http::assertSent(fn (Request $request) => $request['cmd'] === [str_replace(' ', '\ ', PHP_BINARY), 'artisan', 'foo:bar']); |
| 47 | + Http::assertSent(fn (Request $request) => $request['cmd'] === [PHP_BINARY, 'artisan', 'foo:bar']); |
48 | 48 |
|
49 | 49 | ChildProcess::artisan(['foo:baz'], 'some-alias');
|
50 |
| - Http::assertSent(fn (Request $request) => $request['cmd'] === [str_replace(' ', '\ ', PHP_BINARY), 'artisan', 'foo:baz']); |
| 50 | + Http::assertSent(fn (Request $request) => $request['cmd'] === [PHP_BINARY, 'artisan', 'foo:baz']); |
51 | 51 | });
|
52 | 52 |
|
53 | 53 | it('sets the cwd to the base path if none was given', function () {
|
|
63 | 63 | Http::assertSent(fn (Request $request) => $request['cmd'] === ['foo', 'bar', 'baz', 'bak']);
|
64 | 64 | });
|
65 | 65 |
|
66 |
| -it('escapes spaces when passing a command array', function () { |
67 |
| - ChildProcess::start(['path/to/some executable with spaces.sh', '--foo', '--bar'], 'some-alias'); |
68 |
| - Http::assertSent(fn (Request $request) => $request['cmd'] === ['path/to/some\ executable\ with\ spaces.sh', '--foo', '--bar']); |
69 |
| -}); |
70 |
| - |
71 | 66 | it('can stop a child process', function () {
|
72 | 67 | ChildProcess::stop('some-alias');
|
73 | 68 |
|
|
0 commit comments