-
-
Notifications
You must be signed in to change notification settings - Fork 154
Expand file tree
/
Copy pathSystemTestCase.php
More file actions
32 lines (25 loc) · 755 Bytes
/
SystemTestCase.php
File metadata and controls
32 lines (25 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
namespace Phpactor\Tests\System;
use Phpactor\Tests\IntegrationTestCase;
use Symfony\Component\Process\Process;
abstract class SystemTestCase extends IntegrationTestCase
{
protected function phpactorFromStringArgs(string $args, ?string $stdin = null): Process
{
chdir($this->workspaceDir());
$bin = __DIR__ . '/../../bin/phpactor --no-ansi --verbose ';
$process = Process::fromShellCommandline(sprintf(
'%s %s %s',
PHP_BINARY,
$bin,
$args
), null, [
'XDG_CACHE_HOME' => __DIR__ . '/../Assets/Cache',
]);
if ($stdin) {
$process->setInput($stdin);
}
$process->run();
return $process;
}
}