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
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(
public function provideDiagnostics(TextDocumentItem $textDocument, CancellationToken $cancel): Promise
{
return call(function () use ($textDocument) {
$process = new Process(array_merge($this->command, [
$process = new Process(array_merge([PHP_BINARY], $this->command, [
'--uri=' . $textDocument->uri,
sprintf('--config-extra=%s', sprintf('{"%s": false}', WorseReflectionExtension::PARAM_ENABLE_CONTEXT_LOCATION))
]), $this->cwd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function testDiagnostics(): void
private function diagnosticsFor(string $sourceCode): array
{
$process = new Process([
PHP_BINARY,
__DIR__ . '/../../../../../../bin/phpactor',
'language-server:diagnostics',
'--uri=file:///foo',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function describe(string $rule, array $options = []): Promise
public function run(string ...$args): Promise
{
return call(function () use ($args) {
$process = ProcessBuilder::create([$this->binPath, ...$args])->mergeParentEnv()->env($this->env)->build();
$process = ProcessBuilder::create([PHP_BINARY, $this->binPath, ...$args])->mergeParentEnv()->env($this->env)->build();
yield $process->start();

$process->join()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function analyse(string $filename): Promise
{
return \Amp\call(function () use ($filename) {
$args = [
PHP_BINARY,
$this->config->phpstanBin(),
'analyse',
'--no-progress',
Expand Down
1 change: 1 addition & 0 deletions lib/Extension/LanguageServerPsalm/Model/PsalmProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function analyse(string $filename): Promise
{
return \Amp\call(function () use ($filename) {
$command = [
PHP_BINARY,
$this->config->psalmBin(),
sprintf(
'--show-info=%s',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function testLint(string $source, Closure $assertion, int $initLevel = 1,
);
(Process::fromShellCommandline('composer dump', $this->workspace()->path()))->mustRun();

(new Process([$psalmBin, '--init', 'src', $initLevel], $this->workspace()->path()))->mustRun();
(new Process([PHP_BINARY, $psalmBin, '--init', 'src', $initLevel], $this->workspace()->path()))->mustRun();
$this->workspace()->put('src/test.php', $source);
$linter = new PsalmProcess(
$this->workspace()->path(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public function testRefreshIndex(): void
$this->initProject();

$process = new Process([
PHP_BINARY,
__DIR__ . '/../../bin/console',
'index:build',
], $this->workspace()->path());
Expand Down
6 changes: 3 additions & 3 deletions lib/Indexer/Tests/Extension/Command/IndexCleanCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testCleanIndexWithAllInput(array $command, ?string $input): void
$this->initProject();
self::assertFalse($this->workspace()->exists('cache'));

$process = new Process($command, $this->workspace()->path(), null, $input);
$process = new Process([PHP_BINARY, ...$command], $this->workspace()->path(), null, $input);
$process->mustRun();

self::assertEquals(0, $process->getExitCode());
Expand Down Expand Up @@ -61,7 +61,7 @@ public function testCleanIndexWithSpecificInput(array $command, ?string $input):
{
$this->initProject();

$process = new Process($command, $this->workspace()->path(), null, $input);
$process = new Process([PHP_BINARY, ...$command], $this->workspace()->path(), null, $input);
$process->mustRun();

self::assertEquals(0, $process->getExitCode());
Expand Down Expand Up @@ -99,7 +99,7 @@ public function testCleanDoesNotRemoveIndexWithoutInput(array $arguments): void
{
$this->initProject();

$process = new Process($arguments, $this->workspace()->path(), null, null);
$process = new Process([PHP_BINARY, ...$arguments], $this->workspace()->path(), null, null);
$process->mustRun();

self::assertEquals(0, $process->getExitCode());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public function testQueryIndex(string $query): void
$this->initProject();

$process = new Process([
PHP_BINARY,
__DIR__ . '/../../bin/console',
'index:query',
$query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public function testQueryIndex(array $args = []): void
$this->initProject();

$process = new Process(array_merge([
PHP_BINARY,
__DIR__ . '/../../bin/console',
'index:search',
], $args), $this->workspace()->path());
Expand Down
2 changes: 1 addition & 1 deletion tests/IntegrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ abstract class IntegrationTestCase extends TestCase
public function phpactor(array $cmd): Process
{
$p = new Process(array_merge(
[__DIR__ . '/../bin/phpactor'],
[PHP_BINARY, __DIR__ . '/../bin/phpactor'],
$cmd
), $this->workspace()->path());

Expand Down
3 changes: 2 additions & 1 deletion tests/System/SystemTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ protected function phpactorFromStringArgs(string $args, string $stdin = null): P

$bin = __DIR__ . '/../../bin/phpactor --no-ansi --verbose ';
$process = Process::fromShellCommandline(sprintf(
'%s %s',
'%s %s %s',
PHP_BINARY,
$bin,
$args
), null, [
Expand Down