Skip to content

Commit deba693

Browse files
committed
Add Collection to support in expectsPromptTable
1 parent 4bd7b8f commit deba693

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Testing/InteractsWithPrompts.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Laravel\Prompts\Testing;
66

7+
use Illuminate\Support\Collection;
78
use Laravel\Prompts\Note;
89
use Laravel\Prompts\Table;
910
use Laravel\Prompts\Prompt;
@@ -25,8 +26,6 @@ trait InteractsWithPrompts
2526
public function setUpInteractsWithPrompts(): void
2627
{
2728
$expectOutputFromPrompt = function (Prompt $prompt) {
28-
/** @var PendingCommand $this */
29-
3029
$prompt->setOutput($output = new BufferedOutput);
3130
$prompt->display();
3231

@@ -87,7 +86,7 @@ public function setUpInteractsWithPrompts(): void
8786

8887
PendingCommand::macro(
8988
'expectsPromptTable',
90-
fn (array $headers, array $rows) => $expectOutputFromPrompt->call(
89+
fn (array|Collection $headers, array|Collection|null $rows = null) => $expectOutputFromPrompt->call(
9190
$this,
9291
new Table($headers, $rows)
9392
)

0 commit comments

Comments
 (0)