Skip to content

Commit efff7a4

Browse files
committed
IHF: More Artisan\Command tests added.
1 parent 4d05eb4 commit efff7a4

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/classes/Artisan/CommandTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,34 @@ public function run_in_background_supports_before_and_after_commands_both()
8080
$command->runInBackground();
8181
}
8282

83+
/**
84+
* @test
85+
* @runInSeparateProcess
86+
* @preserveGlobalState disabled
87+
*/
88+
public function it_adds_php_option_for_hhvm()
89+
{
90+
$this->shouldRecieveExecCallOnceWith('(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+
97+
/**
98+
* @test
99+
* @runInSeparateProcess
100+
* @preserveGlobalState disabled
101+
*/
102+
public function it_supports_overriding_of_artisan_binary_through_constant()
103+
{
104+
$this->shouldRecieveExecCallOnceWith('(before && php custom-artisan test:command && after) > /dev/null 2>&1 &');
105+
106+
define('ARTISAN_BINARY', 'custom-artisan');
107+
$command = Command::factory('test:command', 'before', 'after');
108+
$command->runInBackground();
109+
}
110+
83111
private function shouldRecieveExecCallOnceWith($with)
84112
{
85113
self::$functions->shouldReceive('exec')->with($with)->once();

0 commit comments

Comments
 (0)