File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -348,7 +348,7 @@ public function withFakeHandlers(array $fakeHandlers)
348
348
protected function fakeFor (string $ command )
349
349
{
350
350
return collect ($ this ->fakeHandlers )
351
- ->first (fn ($ handler , $ pattern ) => Str::is ($ pattern , $ command ));
351
+ ->first (fn ($ handler , $ pattern ) => $ pattern === ' * ' || Str::is ($ pattern , $ command ));
352
352
}
353
353
354
354
/**
Original file line number Diff line number Diff line change @@ -148,6 +148,26 @@ public function testBasicProcessFake()
148
148
$ this ->assertTrue ($ result ->successful ());
149
149
}
150
150
151
+ public function testBasicProcessFakeWithMultiLineCommand ()
152
+ {
153
+ $ factory = new Factory ;
154
+
155
+ $ factory ->preventStrayProcesses ();
156
+
157
+ $ factory ->fake ([
158
+ '* ' => 'The output ' ,
159
+ ]);
160
+
161
+ $ result = $ factory ->run (<<<'COMMAND'
162
+ git clone --depth 1 \
163
+ --single-branch \
164
+ --branch main \
165
+ git://some-url .
166
+ COMMAND);
167
+
168
+ $ this ->assertSame (0 , $ result ->exitCode ());
169
+ }
170
+
151
171
public function testProcessFakeExitCodes ()
152
172
{
153
173
$ factory = new Factory ;
You can’t perform that action at this time.
0 commit comments