Skip to content

Commit

Permalink
Update ServeCommandTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Nov 12, 2024
1 parent 64f43c1 commit 26b291e
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,8 @@ public function testHydeServeCommandWithViteOption()
{
$mockViteProcess = mock(InvokedProcess::class);
$mockViteProcess->shouldReceive('running')
->times(2)
->andReturn(true, false);
$mockViteProcess->shouldReceive('latestOutput')
->once()
->andReturn('vite output');
->andReturn(false);

$mockServerProcess = mock(InvokedProcess::class);
$mockServerProcess->shouldReceive('running')
Expand All @@ -212,7 +209,8 @@ public function testHydeServeCommandWithViteOption()

Process::shouldReceive('start')
->once()
->withArgs(function (string $command, Closure $handle) {
->withArgs(function (string $command, Closure $output) {
$output('stdout', 'vite output');
return $command === "php -S localhost:8080 {$this->binaryPath()}";
})
->andReturn($mockServerProcess);
Expand Down

0 comments on commit 26b291e

Please sign in to comment.