Skip to content

Commit 23195b4

Browse files
Fix expectations for output assertions. 🧪 (#44723)
1 parent db172a4 commit 23195b4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎src/Illuminate/Testing/PendingCommand.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,8 @@ private function createABufferedOutputMock()
419419

420420
foreach ($this->test->expectedOutputSubstrings as $i => $text) {
421421
$mock->shouldReceive('doWrite')
422+
->atLeast()
423+
->times(0)
422424
->withArgs(fn ($output) => str_contains($output, $text))
423425
->andReturnUsing(function () use ($i) {
424426
unset($this->test->expectedOutputSubstrings[$i]);
@@ -427,6 +429,8 @@ private function createABufferedOutputMock()
427429

428430
foreach ($this->test->unexpectedOutput as $output => $displayed) {
429431
$mock->shouldReceive('doWrite')
432+
->atLeast()
433+
->times(0)
430434
->ordered()
431435
->with($output, Mockery::any())
432436
->andReturnUsing(function () use ($output) {
@@ -436,6 +440,8 @@ private function createABufferedOutputMock()
436440

437441
foreach ($this->test->unexpectedOutputSubstrings as $text => $displayed) {
438442
$mock->shouldReceive('doWrite')
443+
->atLeast()
444+
->times(0)
439445
->withArgs(fn ($output) => str_contains($output, $text))
440446
->andReturnUsing(function () use ($text) {
441447
$this->test->unexpectedOutputSubstrings[$text] = true;

0 commit comments

Comments
 (0)