Skip to content

Commit 3f2dabd

Browse files
committed
IHF: Simplified.
1 parent ef845ac commit 3f2dabd

File tree

2 files changed

+3
-35
lines changed

2 files changed

+3
-35
lines changed

src/classes/Artisan/Command.php

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Illuminated\Helpers\Artisan;
44

55
use Symfony\Component\Process\PhpExecutableFinder;
6-
use Symfony\Component\Process\ProcessUtils;
76

87
class Command
98
{
@@ -53,23 +52,11 @@ protected function composeForRun()
5352
protected function getPhpBinary()
5453
{
5554
$finder = new PhpExecutableFinder();
56-
$phpBinary = $finder->find(false);
57-
58-
$phpBinary = ProcessUtils::escapeArgument($phpBinary);
59-
if (defined('HHVM_VERSION')) {
60-
$phpBinary .= ' --php';
61-
}
62-
63-
return $phpBinary;
55+
return $finder->find();
6456
}
6557

6658
protected function getArtisan()
6759
{
68-
$artisan = 'artisan';
69-
if (defined('ARTISAN_BINARY')) {
70-
$artisan = ProcessUtils::escapeArgument(ARTISAN_BINARY);
71-
}
72-
73-
return $artisan;
60+
return defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan';
7461
}
7562
}

tests/classes/Artisan/CommandTest.php

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@ protected function setUp()
1515
self::$functions = Mockery::mock();
1616

1717
$phpBinaryMock = Mockery::mock('overload:Symfony\Component\Process\PhpExecutableFinder');
18-
$phpBinaryMock->shouldReceive('find')->with(false)->zeroOrMoreTimes()->andReturn('php');
19-
20-
$utilsMock = Mockery::mock('alias:Symfony\Component\Process\ProcessUtils');
21-
$utilsMock->shouldReceive('escapeArgument')->withAnyArgs()->zeroOrMoreTimes()->andReturnUsing(function ($value) {
22-
return $value;
23-
});
18+
$phpBinaryMock->shouldReceive('find')->withNoArgs()->zeroOrMoreTimes()->andReturn('php');
2419
}
2520

2621
/** @test */
@@ -80,20 +75,6 @@ public function run_in_background_supports_before_and_after_subcommands_together
8075
$command->runInBackground();
8176
}
8277

83-
/**
84-
* @test
85-
* @runInSeparateProcess
86-
* @preserveGlobalState disabled
87-
*/
88-
public function it_adds_php_option_for_hhvm()
89-
{
90-
$this->shouldReceiveExecCallOnceWith('(before && php --php artisan test:command && after) > /dev/null 2>&1 &');
91-
92-
define('HHVM_VERSION', true);
93-
$command = Command::factory('test:command', 'before', 'after');
94-
$command->runInBackground();
95-
}
96-
9778
/**
9879
* @test
9980
* @runInSeparateProcess

0 commit comments

Comments
 (0)