Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Illuminate/Process/PendingProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public function options(array $options)
*/
public function run(array|string|null $command = null, ?callable $output = null)
{
$this->command = $command ?: $this->command;
$this->command = $command ?? $this->command;

$process = $this->toSymfonyProcess($command);

Expand Down Expand Up @@ -274,7 +274,7 @@ public function run(array|string|null $command = null, ?callable $output = null)
*/
public function start(array|string|null $command = null, ?callable $output = null)
{
$this->command = $command ?: $this->command;
$this->command = $command ?? $this->command;

$process = $this->toSymfonyProcess($command);

Expand Down
24 changes: 24 additions & 0 deletions tests/Process/ProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,30 @@ public function testBasicFakeAssertions()
});
}

public function testAssertRanWithFalsyCommandString(): void
{
$factory = new Factory;

$factory->fake();

$factory->run('0');

$factory->assertRan('0');
$factory->assertRanTimes('0', 1);
$factory->assertNotRan('ls -la');
}

public function testAssertRanWithFalsyStartedCommandString(): void
{
$factory = new Factory;

$factory->fake();

$factory->start('0')->wait();

$factory->assertRan('0');
}

public function testAssertingThatNothingRan()
{
$factory = new Factory;
Expand Down