Skip to content

Commit

Permalink
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Process/PendingProcess.php
Original file line number Diff line number Diff line change
@@ -348,7 +348,7 @@ public function withFakeHandlers(array $fakeHandlers)
protected function fakeFor(string $command)
{
return collect($this->fakeHandlers)
->first(fn ($handler, $pattern) => Str::is($pattern, $command));
->first(fn ($handler, $pattern) => $pattern === '*' || Str::is($pattern, $command));
}

/**
20 changes: 20 additions & 0 deletions tests/Process/ProcessTest.php
Original file line number Diff line number Diff line change
@@ -148,6 +148,26 @@ public function testBasicProcessFake()
$this->assertTrue($result->successful());
}

public function testBasicProcessFakeWithMultiLineCommand()
{
$factory = new Factory;

$factory->preventStrayProcesses();

$factory->fake([
'*' => 'The output',
]);

$result = $factory->run(<<<'COMMAND'
git clone --depth 1 \
--single-branch \
--branch main \
git://some-url .
COMMAND);

$this->assertSame(0, $result->exitCode());
}

public function testProcessFakeExitCodes()
{
$factory = new Factory;

0 comments on commit 08bf276

Please sign in to comment.