Skip to content

Commit ae4671b

Browse files
committed
test: don't use double quotes with echo
1 parent f8a61ba commit ae4671b

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

packages/process/tests/GenericProcessExecutorTest.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,27 @@ final class GenericProcessExecutorTest extends TestCase
1919
public function test_run_string(): void
2020
{
2121
$executor = new GenericProcessExecutor();
22-
$result = $executor->run('echo "hello world"');
22+
$result = $executor->run('echo hello');
2323

24-
$this->assertStringEqualsStringIgnoringLineEndings("hello world\n", $result->output);
24+
$this->assertStringEqualsStringIgnoringLineEndings("hello\n", $result->output);
2525
$this->assertSame('', $result->errorOutput);
2626
$this->assertSame(0, $result->exitCode);
2727
}
2828

2929
public function test_run(): void
3030
{
3131
$executor = new GenericProcessExecutor();
32-
$result = $executor->run(new PendingProcess('echo "hello world"'));
32+
$result = $executor->run(new PendingProcess('echo hello'));
3333

34-
$this->assertStringEqualsStringIgnoringLineEndings("hello world\n", $result->output);
34+
$this->assertStringEqualsStringIgnoringLineEndings("hello\n", $result->output);
3535
$this->assertSame('', $result->errorOutput);
3636
$this->assertSame(0, $result->exitCode);
3737
}
3838

3939
public function test_start(): void
4040
{
4141
$executor = new GenericProcessExecutor();
42-
$process = $executor->start('echo "hello world"');
42+
$process = $executor->start('echo hello');
4343

4444
$this->assertIsInt($process->pid);
4545
$this->assertTrue($process->running);
@@ -50,18 +50,18 @@ public function test_start(): void
5050

5151
$this->assertNull($process->pid);
5252
$this->assertFalse($process->running);
53-
$this->assertSame("hello world\n", $process->output);
53+
$this->assertStringEqualsStringIgnoringLineEndings("hello\n", $process->output);
5454
$this->assertSame('', $process->errorOutput);
5555

56-
$this->assertStringEqualsStringIgnoringLineEndings("hello world\n", $result->output);
56+
$this->assertStringEqualsStringIgnoringLineEndings("hello\n", $result->output);
5757
$this->assertSame('', $result->errorOutput);
5858
$this->assertSame(0, $result->exitCode);
5959
}
6060

6161
public function test_wait_callback(): void
6262
{
6363
$executor = new GenericProcessExecutor();
64-
$process = $executor->start('echo "hello world"');
64+
$process = $executor->start('echo hello');
6565

6666
$output = [];
6767
$process->wait(function (OutputChannel $channel, string $data) use (&$output) {
@@ -71,7 +71,7 @@ public function test_wait_callback(): void
7171

7272
$this->assertCount(1, $output);
7373
$this->assertArrayHasKey(OutputChannel::OUTPUT->value, $output);
74-
$this->assertStringEqualsStringIgnoringLineEndings("hello world\n", $output[OutputChannel::OUTPUT->value][0]);
74+
$this->assertStringEqualsStringIgnoringLineEndings("hello\n", $output[OutputChannel::OUTPUT->value][0]);
7575
}
7676

7777
public function test_run_timeout(): void
@@ -95,9 +95,9 @@ public function test_run_idle_timeout(): void
9595
public function test_run_input(): void
9696
{
9797
$executor = new GenericProcessExecutor();
98-
$result = $executor->run(new PendingProcess('cat', input: 'hello world'));
98+
$result = $executor->run(new PendingProcess('cat', input: 'hello'));
9999

100-
$this->assertSame('hello world', $result->output);
100+
$this->assertSame('hello', $result->output);
101101
$this->assertSame('', $result->errorOutput);
102102
$this->assertSame(0, $result->exitCode);
103103
}
@@ -131,9 +131,9 @@ public function test_run_with_env(): void
131131
$this->skipOnWindows();
132132

133133
$executor = new GenericProcessExecutor();
134-
$result = $executor->run(new PendingProcess('echo $TEST_ENV', environment: ['TEST_ENV' => 'hello world']));
134+
$result = $executor->run(new PendingProcess('echo $TEST_ENV', environment: ['TEST_ENV' => 'hello']));
135135

136-
$this->assertStringEqualsStringIgnoringLineEndings("hello world\n", $result->output);
136+
$this->assertStringEqualsStringIgnoringLineEndings("hello\n", $result->output);
137137
$this->assertSame('', $result->errorOutput);
138138
$this->assertSame(0, $result->exitCode);
139139
}

0 commit comments

Comments
 (0)