wrapped = $this->createMock(ProcessRunnerInterface::class); $this->executableFinder = $this->createMock(PhpExecutableFinder::class); } #[Test] #[TestWith([false, 'php'])] #[TestWith(['/usr/local/bin/php', '/usr/local/bin/php'])] public function commandsArePrefixedWithPhp(string|false $resolvedExecutable, string $expectedExecutable): void { $output = $this->createStub(OutputInterface::class); $command = ['foo', 'bar', 'baz']; $this->wrapped->expects($this->once())->method('run')->with($output, [$expectedExecutable, ...$command]); $this->executableFinder->expects($this->once())->method('find')->with(false)->willReturn($resolvedExecutable); new PhpProcessRunner($this->wrapped, $this->executableFinder)->run($output, $command); } }