File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ protected function getExecutablePath(): string
5252 return Hyde::path ('vendor/hyde/realtime-compiler/bin/server.php ' );
5353 }
5454
55- /** @codeCoverageIgnore Until output is testable */
5655 protected function runServerProcess (string $ command ): void
5756 {
5857 Process::forever ()->run ($ command , function (string $ type , string $ line ): void {
Original file line number Diff line number Diff line change 44
55namespace Hyde \Framework \Testing \Feature \Commands ;
66
7+ use Closure ;
78use Hyde \Hyde ;
89use Hyde \Testing \TestCase ;
910use Illuminate \Support \Facades \Process ;
@@ -135,16 +136,24 @@ public function test_hyde_serve_command_with_invalid_config_value()
135136
136137 public function test_hyde_serve_command_passes_through_process_output ()
137138 {
138- $ this ->markTestSkipped ('Unable to access the output of the process. Assuming vendor bug for now. ' );
139+ Process::shouldReceive ('forever ' )
140+ ->once ()
141+ ->withNoArgs ()
142+ ->andReturnSelf ();
139143
140- Process::fake (['php -S localhost:8080 {$this->binaryPath()} ' => 'foo ' ]);
144+ Process::shouldReceive ('run ' )
145+ ->once ()
146+ ->withArgs (function (string $ command , Closure $ handle ) {
147+ $ handle ('type ' , 'foo ' );
148+
149+ return $ command === "php -S localhost:8080 {$ this ->binaryPath ()}" ;
150+ })
151+ ->andReturnSelf ();
141152
142153 $ this ->artisan ('serve ' )
143154 ->expectsOutput ('Starting the HydeRC server... Press Ctrl+C to stop ' )
144155 ->expectsOutput ('foo ' )
145156 ->assertExitCode (0 );
146-
147- Process::assertRan ("php -S localhost:8080 {$ this ->binaryPath ()}" );
148157 }
149158
150159 protected function binaryPath (): string
You can’t perform that action at this time.
0 commit comments